Skip to content

Commit

Permalink
feat(persisted-ops): Close both file and reader using defer
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebruijn committed Aug 9, 2024
1 parent 110e0aa commit 227f01e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/business/persistedoperations/gcp_storage_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ func (g *GcpStorageLoader) Load(ctx context.Context) error {
var errs []error
for {
attrs, err := it.Next()
numberOfFilesProcessed++

if errors.Is(err, iterator.Done) {
break
}
if err != nil {
// if any error is returned, any subsequent call returns the same error
// so we break here
errs = append(errs, err)
break
}
Expand Down

0 comments on commit 227f01e

Please sign in to comment.