Skip to content

Commit

Permalink
Merge pull request #825 from ElenaHenderson/remove-hard-codes-sleep-c…
Browse files Browse the repository at this point in the history
…onsumer-fetch-batches

Issue 823 > Use max_wait_time while sleeping in fetch_batches
  • Loading branch information
dasch committed May 5, 2020
2 parents 8660d05 + 9ed5ecc commit 703bf80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kafka/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def fetch_batches

if !@fetcher.data?
@logger.debug "No batches to process"
sleep 2
sleep(@fetcher.max_wait_time || 2)
[]
else
tag, message = @fetcher.poll
Expand Down
2 changes: 1 addition & 1 deletion lib/kafka/fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Kafka
class Fetcher
attr_reader :queue
attr_reader :queue, :max_wait_time

def initialize(cluster:, logger:, instrumenter:, max_queue_size:, group:)
@cluster = cluster
Expand Down

0 comments on commit 703bf80

Please sign in to comment.