summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-09-13 23:46:29 +0800
committerKeuin <[email protected]>2022-09-13 23:46:29 +0800
commited3db79b86e9ea2c796cccedf1454a45823293a4 (patch)
tree678f1a968048b57077b2b4eea0235414c009324a /common
parent6aaed5b0de0ba2e07f497984a8068815a646cd37 (diff)
Bugfix: task won't stop after Ctrl-C is sent.v0.3.2
Diffstat (limited to 'common')
-rw-r--r--common/copy.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/copy.go b/common/copy.go
index 1d273dc..27bc9ad 100644
--- a/common/copy.go
+++ b/common/copy.go
@@ -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)])