From ed3db79b86e9ea2c796cccedf1454a45823293a4 Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 13 Sep 2022 23:46:29 +0800 Subject: Bugfix: task won't stop after Ctrl-C is sent. --- common/copy.go | 1 + 1 file changed, 1 insertion(+) (limited to 'common/copy.go') 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)]) -- cgit v1.2.3