Class: Istox::RedisManager
- Inherits:
-
Object
- Object
- Istox::RedisManager
- Defined in:
- lib/istox/helpers/redis_manager.rb
Class Method Summary collapse
-
.otp_redis ⇒ Object
for otp of SNS.
-
.rate_limit_redis ⇒ Object
for rate limit redis cache.
-
.remote_model_redis ⇒ Object
for remote model cache.
-
.request_redis ⇒ Object
cache request to prevent double submission.
-
.sendgrid_email_templates ⇒ Object
for send_grid email templates cache.
Class Method Details
.otp_redis ⇒ Object
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_redis ⇒ Object
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_redis ⇒ Object
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_redis ⇒ Object
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_templates ⇒ Object
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 |