backup: cleanly shutdown goroutines on error

This commit is contained in:
Michael Eischer
2021-05-15 23:06:12 +02:00
parent 5767c65c62
commit fd8bce8184
2 changed files with 8 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ func deleteFiles(gopts GlobalOptions, ignoreError bool, repo restic.Repository,
select {
case fileChan <- id:
case <-ctx.Done():
return nil
return ctx.Err()
}
}
return nil