Skip to content

Commit

Permalink
feat: sync file to stable storage before returning from save method
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLoch committed Mar 2, 2024
1 parent c5ff6cb commit d4f9828
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func (f *fsStorage) Save(key, etag string, data []byte) error {
return fmt.Errorf("writing data to file %q: %w", filePath, err)
}

if err := file.Sync(); err != nil {
return fmt.Errorf("syncing file %q to stable storage: %w", filePath, err)
}

return nil
}

Expand Down

0 comments on commit d4f9828

Please sign in to comment.