Skip to content

Commit

Permalink
Bugfix: task won't stop after Ctrl-C is sent.
Browse files Browse the repository at this point in the history
  • Loading branch information
keuin committed Sep 13, 2022
1 parent 6aaed5b commit ed3db79
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions common/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func CopyToFileWithBuffer(
for {
select {
case <-ctx.Done():
err = ctx.Err()
return
default:
nRead, err = in.Read(buffer[off:Min[int](off+chunkSize, bufSize)])
Expand Down

0 comments on commit ed3db79

Please sign in to comment.