lib/resque/worker.rb
def reconnect
      tries = 0
      begin
        redis.client.reconnect
      rescue Redis::BaseConnectionError
        if (tries += 1) <= 3
          Resque.logger.info "Error reconnecting to Redis; retrying"
          sleep(tries)
          retry
        else
          Resque.logger.info "Error reconnecting to Redis; quitting"
          raise
        end
      end
    end
# Reconnect to Redis to avoid sharing a connection with the parent,
# retry up to 3 times with increasing delay before giving up.
Reconnect to Redis to avoid sharing a connection with the parent,
retry up to 3 times with increasing delay before giving up.
Reconnect to Redis to avoid sharing a connection with the parent retry up to 3 times with increasing delay before giving up .
def reconnect
      tries = 0
      begin
        redis.client.reconnect
      rescue Redis::BaseConnectionError
        if (tries += 1) <= 3
          Resque.logger.info "Error reconnecting to Redis; retrying"
          sleep(tries)
          retry
        else
          Resque.logger.info "Error reconnecting to Redis; quitting"
          raise
        end
      end
    end
def reconnect tries = 0 begin redis . client . reconnect rescue Redis :: BaseConnectionError if ( tries += 1 ) <= 3 Resque . logger . info "Error reconnecting to Redis; retrying" sleep ( tries ) retry else Resque . logger . info "Error reconnecting to Redis; quitting" raise end end end
Reconnect to Redis to avoid sharing a connection with the parent,
retry up to 3 times with increasing delay before giving up.
Reconnect to Redis to avoid sharing a connection with the parent retry up to 3 times with increasing delay before giving up .