Skip to content

Commit 76eb287

Browse files
committed
[Chore] Refactor code in consumer
1 parent 2f14b94 commit 76eb287

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/kafka/consumer.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ def each_message(min_bytes: 1, max_bytes: 10485760, max_wait_time: 1, automatica
218218
)
219219

220220
consumer_loop do
221-
refresh_topic_list_if_enabled
222221
batches = fetch_batches
223222

224223
batches.each do |batch|
@@ -307,7 +306,6 @@ def each_batch(min_bytes: 1, max_bytes: 10485760, max_wait_time: 1, automaticall
307306
)
308307

309308
consumer_loop do
310-
refresh_topic_list_if_enabled
311309
batches = fetch_batches
312310

313311
batches.each do |batch|
@@ -413,6 +411,7 @@ def consumer_loop
413411
while running?
414412
begin
415413
@instrumenter.instrument("loop.consumer") do
414+
refresh_topic_list_if_enabled
416415
yield
417416
end
418417
rescue HeartbeatError

0 commit comments

Comments
 (0)