Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wk989898 committed Dec 3, 2024
1 parent 58d19a1 commit 2da8c87
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/kafka-consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ func (c *consumer) Consume(ctx context.Context) {
}
}()
for {
select {
case <-ctx.Done():
log.Info("consumer exist: context cancelled")
break
default:
}
msg, err := c.client.ReadMessage(-1)
if err != nil {
log.Error("read message failed, just continue to retry", zap.Error(err))
Expand Down

0 comments on commit 2da8c87

Please sign in to comment.