Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/20250814104556.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:bug: [parallelisation] Make sure options are not overridden for a close store
8 changes: 4 additions & 4 deletions utils/parallelisation/onclose.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewCloserStore(stopOnFirstError bool) *CloserStore {
if stopOnFirstError {
option = StopOnFirstError
}
return NewCloserStoreWithOptions(option, Parallel)
return NewCloserStoreWithOptions(option, Parallel, RetainAfterExecution)
}

// NewCloserStoreWithOptions returns a store of io.Closer object which will all be closed on Close(). The first error received if any will be returned
Expand All @@ -40,7 +40,7 @@ func NewCloserStoreWithOptions(opts ...StoreOption) *CloserStore {
return commonerrors.UndefinedVariable("closer object")
}
return closerObj.Close()
}, append(opts, RetainAfterExecution)...),
}, opts...),
}
}

Expand Down Expand Up @@ -125,7 +125,7 @@ func NewCloseFunctionStore(options ...StoreOption) *CloseFunctionStore {
return &CloseFunctionStore{
store: *newFunctionStore[CloseFunc](func(_ context.Context, closerObj CloseFunc) error {
return closerObj()
}, append(options, RetainAfterExecution)...),
}, options...),
}
}

Expand All @@ -141,5 +141,5 @@ func NewConcurrentCloseFunctionStore(stopOnFirstError bool) *CloseFunctionStore
if stopOnFirstError {
option = StopOnFirstError
}
return NewCloseFunctionStore(option, Parallel)
return NewCloseFunctionStore(option, Parallel, RetainAfterExecution)
}
Loading