Skip to content

Commit 0229014

Browse files
committed
chore: check stop channel close
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent dfa7c26 commit 0229014

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

redis.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ func (s *Worker) Run() error {
265265
for {
266266
select {
267267
case m, ok := <-ch:
268+
select {
269+
case <-s.stop:
270+
return nil
271+
default:
272+
}
273+
268274
if !ok {
269275
return fmt.Errorf("redis pubsub: channel=%s closed", s.channel)
270276
}

0 commit comments

Comments
 (0)