diff --git a/lib/beaneater/connection.rb b/lib/beaneater/connection.rb index bbb1748..c68e615 100644 --- a/lib/beaneater/connection.rb +++ b/lib/beaneater/connection.rb @@ -70,7 +70,7 @@ def initialize(address) # @conn.transmit('stats') # def transmit(command, **options) - _with_retry(**options.slice(:retry_interval, :init)) do + _with_retry(options[:retry_interval], options[:init]) do @mutex.synchronize do _raise_not_connected! unless connection @@ -189,7 +189,7 @@ def _initialize_tubes # @param [Integer] tries The maximum number of tries in draining mode # @return [Object] Result of the block passed # - def _with_retry(retry_interval: DEFAULT_RETRY_INTERVAL, init: true, tries: MAX_RETRIES, &block) + def _with_retry(retry_interval = DEFAULT_RETRY_INTERVAL, init = true, tries = MAX_RETRIES, &block) yield rescue EOFError, Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNREFUSED => ex