Skip to content

Commit

Permalink
fix: change Kafka poll to block for 100ms instead of 100ns when no ev…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
fbgava-wildlife committed Dec 17, 2024
1 parent c749415 commit be8520b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion feedback/kafka_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package feedback
import (
"context"
"sync"
"time"

"github.com/confluentinc/confluent-kafka-go/v2/kafka"
"github.com/getsentry/raven-go"
Expand Down Expand Up @@ -211,7 +212,7 @@ func (q *KafkaConsumer) ConsumeLoop(ctx context.Context) error {
l.Info("context done, stopping consuming")
return nil
default:
message, err := q.Consumer.ReadMessage(100)
message, err := q.Consumer.ReadMessage(100 * time.Millisecond)
if message == nil && err.(kafka.Error).IsTimeout() {
continue
}
Expand Down

0 comments on commit be8520b

Please sign in to comment.