Skip to content

Commit 58ea79a

Browse files
committed
[Chore] Refactor code
1 parent 5a68744 commit 58ea79a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: lib/kafka/consumer.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,9 @@ def clear_current_offsets(excluding: {})
594594

595595
def scan_for_subscribing
596596
@subscribed_topics.each do |topic_or_regex, config|
597-
default_offset = config[:default_offset]
598-
start_from_beginning = config[:start_from_beginning]
599-
max_bytes_per_partition = config[:max_bytes_per_partition]
597+
default_offset = config.fetch(:default_offset)
598+
start_from_beginning = config.fetch(:start_from_beginning)
599+
max_bytes_per_partition = config.fetch(:max_bytes_per_partition)
600600
if topic_or_regex.is_a?(Regexp)
601601
subscribe_to_regex(topic_or_regex, default_offset, start_from_beginning, max_bytes_per_partition)
602602
else

0 commit comments

Comments
 (0)