Module: Faulty::Patch::Redis::Middleware

Includes:
Base
Defined in:
lib/faulty/patch/redis/middleware.rb

Instance Method Summary collapse

Methods included from Base

#faulty_run

Instance Method Details

#call(commands, redis_config) ⇒ Object



32
33
34
# File 'lib/faulty/patch/redis/middleware.rb', line 32

def call(commands, redis_config)
  faulty_run { wrap_command { super } }
end

#call_pipelined(commands, redis_config) ⇒ Object



36
37
38
# File 'lib/faulty/patch/redis/middleware.rb', line 36

def call_pipelined(commands, redis_config)
  faulty_run { wrap_command { super } }
end

#connect(redis_config) ⇒ Object



28
29
30
# File 'lib/faulty/patch/redis/middleware.rb', line 28

def connect(redis_config)
  faulty_run { super }
end

#initialize(client) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/faulty/patch/redis/middleware.rb', line 14

def initialize(client)
  @faulty_circuit = Patch.circuit_from_hash(
    'redis',
    client.config.custom[:faulty],
    errors: [
      ::RedisClient::ConnectionError,
      BusyError
    ],
    patched_error_mapper: Faulty::Patch::Redis
  )

  super
end