mirror of
https://github.com/restic/restic.git
synced 2026-10-08 11:27:12 +00:00
backup: Fix shutdown hang when running in the background
On shutdown the backup commands waits for the terminal output goroutine to stop. However while running in the background the goroutine ignored the canceled context.
This commit is contained in:
1 parent
3264eae9f6
commit
401ef92c5f
2 files changed
+10
-4
No files matched your search
@@ -96,11 +96,9 @@ func (t *Terminal) run(ctx context.Context) {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
if IsProcessBackground(t.fd) {
|
||||
// ignore all messages, do nothing, we are in the background process group
|
||||
continue
|
||||
if !IsProcessBackground(t.fd) {
|
||||
t.undoStatus(len(status))
|
||||
}
|
||||
t.undoStatus(len(status))
|
||||
|
||||
return
|
||||
|
||||
|
||||
Reference in new issue
Block a user