mirror of
https://github.com/octoleo/restic.git
synced 2025-02-03 12:28:30 +00:00
restore: fix hang on command cancelation
This commit is contained in:
parent
375c572c4f
commit
31887ea9aa
@ -192,6 +192,7 @@ func (r *fileRestorer) restoreFiles(ctx context.Context) error {
|
|||||||
|
|
||||||
// the main restore loop
|
// the main restore loop
|
||||||
wg.Go(func() error {
|
wg.Go(func() error {
|
||||||
|
defer close(downloadCh)
|
||||||
for _, id := range packOrder {
|
for _, id := range packOrder {
|
||||||
pack := packs[id]
|
pack := packs[id]
|
||||||
// allow garbage collection of packInfo
|
// allow garbage collection of packInfo
|
||||||
@ -203,7 +204,6 @@ func (r *fileRestorer) restoreFiles(ctx context.Context) error {
|
|||||||
debug.Log("Scheduled download pack %s", pack.id.Str())
|
debug.Log("Scheduled download pack %s", pack.id.Str())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(downloadCh)
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user