lib/em-hiredis/base_client.rb in gilmour-em-hiredis-0.3.2 vs lib/em-hiredis/base_client.rb in gilmour-em-hiredis-0.3.3

- old
+ new

@@ -208,11 +208,11 @@ deferred = EM::DefaultDeferrable.new # Shortcut for defining the callback case with just a block deferred.callback { |result| yield(result) } if block_given? if @connected - res = @connection.send_command(sym, args) @defs.push(deferred) + res = @connection.send_command(sym, args) # @connected can be in a stale state. send_command will fail and return # 0 (if EM pure_ruby implmentation is not used). In that case, queue up # the command once to be retried on reconnection if @connection.error? && res && res.kind_of?(Numeric) && res == 0 @command_queue << [deferred, sym, args]