Class: Istox::RedisManager

Inherits:
Object
  • Object
show all
Defined in:
lib/istox/helpers/redis_manager.rb

Class Method Summary collapse

Class Method Details

.rate_limit_redisObject

for rate limit redis cache



21
22
23
24
25
26
# File 'lib/istox/helpers/redis_manager.rb', line 21

def rate_limit_redis
  @rate_limit_redis ||= Redis::Namespace.new(:rate_limit_cache, redis: Redis.new(
    url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
    db: 6
  ))
end

.remote_model_redisObject

for remote model cache



5
6
7
8
9
10
# File 'lib/istox/helpers/redis_manager.rb', line 5

def remote_model_redis
  @remote_model_redis ||= Redis::Namespace.new(:platform_cache, redis: Redis.new(
    url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
    db: 5
  ))
end

.request_redisObject

cache request to prevent double submission



13
14
15
16
17
18
# File 'lib/istox/helpers/redis_manager.rb', line 13

def request_redis
  @request_redis ||= Redis::Namespace.new(:request_cache, redis: Redis.new(
    url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
    db: 6
  ))
end