diff options
author | Keuin <[email protected]> | 2022-09-08 01:14:20 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-09-08 01:14:20 +0800 |
commit | 493ad1a723f9ade3bd049b156f0dc4d194f8fd3e (patch) | |
tree | f9d76845a7ae5382e58b13936d732de2b3e98598 /bilibili/streaming.go | |
parent | 1009e88ff752525966708c56190c2dfa32bc9537 (diff) |
Completely fix timing of goroutines. Implement graceful shutdown correctly.
Diffstat (limited to 'bilibili/streaming.go')
-rw-r--r-- | bilibili/streaming.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/bilibili/streaming.go b/bilibili/streaming.go index 5407043..f6ffac9 100644 --- a/bilibili/streaming.go +++ b/bilibili/streaming.go @@ -62,11 +62,7 @@ func (b Bilibili) CopyLiveStream( // blocking copy n, err := common.Copy(ctx, out, resp.Body) - if errors.Is(err, context.Canceled) { - // cancelled by context - // this error is useless - err = nil - } else { + if !errors.Is(err, context.Canceled) { // real error happens b.error.Printf("Stream copying was interrupted unexpectedly: %v", err) } |