Class: Istox::RedisManager

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

Class Method Summary collapse

Class Method Details

.otp_redisObject

for otp of SNS



37
38
39
40
41
42
# File 'lib/istox/helpers/redis_manager.rb', line 37

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

.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

.sendgrid_email_templatesObject

for send_grid email templates cache



29
30
31
32
33
34
# File 'lib/istox/helpers/redis_manager.rb', line 29

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