Skip to content

Commit

Permalink
reorder close/fsync
Browse files Browse the repository at this point in the history
  • Loading branch information
kasey committed Feb 22, 2024
1 parent e82517e commit 43bbe7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions beacon-chain/db/filesystem/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ func (bs *BlobStorage) Save(sidecar blocks.VerifiedROBlob) error {
}
return errors.Wrap(err, "failed to write to partial file")
}
err = partialFile.Close()
if err != nil {
if err := partialFile.Sync(); err != nil {
return err
}
if err := partialFile.Sync(); err != nil {
err = partialFile.Close()
if err != nil {
return err
}

Expand Down

0 comments on commit 43bbe7b

Please sign in to comment.