mirror of
https://github.com/restic/restic.git
synced 2026-06-02 07:09:43 +00:00
backup: prevent hang using --stdin-from-command if upload fails (#21829)
This commit is contained in:
@@ -97,5 +97,8 @@ func (fp *CommandReader) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// This line can only be reached if the command was not read until the end. This can, for example,
|
||||
// happen if a backup run is interrupted. Kill the command to avoid hanging.
|
||||
_ = fp.cmd.Cancel()
|
||||
return fp.wait()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user