mirror of
https://github.com/restic/restic.git
synced 2025-08-12 11:57:56 +00:00
defer close(ch) outside repository.RunWorkers
This commit is contained in:
@@ -135,14 +135,10 @@ func (c *Checker) LoadIndex(ctx context.Context) (hints []error, errs []error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// final closes indexCh after all workers have terminated
|
||||
final := func() {
|
||||
close(resultCh)
|
||||
}
|
||||
|
||||
// run workers on ch
|
||||
wg.Go(func() error {
|
||||
return repository.RunWorkers(defaultParallelism, worker, final)
|
||||
defer close(resultCh)
|
||||
return repository.RunWorkers(defaultParallelism, worker)
|
||||
})
|
||||
|
||||
// receive decoded indexes
|
||||
|
Reference in New Issue
Block a user