diff --git a/pubsub/redis.go b/pubsub/redis.go index 581664823..3ddca4f15 100644 --- a/pubsub/redis.go +++ b/pubsub/redis.go @@ -142,7 +142,11 @@ func (s *redisSubscriber) start(ctx context.Context) { select { case <-ctx.Done(): return - case msg := <-ch: + case msg, ok := <-ch: + if !ok { + log.Ctx(ctx).Debug().Msg("redis channel was closed") + return + } if err := s.handler([]byte(msg.Payload)); err != nil { log.Ctx(ctx).Err(err).Msg("received an error from handler function") }