chore: refactor redis config (#1310)

- refactor Redis config in Redis::Config Module
-  unit tests for Redis::Config module
This commit is contained in:
Abhishek
2020-10-05 20:01:10 +08:00
committed by GitHub
parent 1e1300c9d2
commit 77d380dd6b
4 changed files with 116 additions and 27 deletions

View File

@@ -1,12 +1,7 @@
sidekiq_redis_config = {
url: ENV.fetch('REDIS_URL', 'redis://127.0.0.1:6379'),
password: ENV.fetch('REDIS_PASSWORD', nil).presence
}
Sidekiq.configure_client do |config|
config.redis = sidekiq_redis_config.merge(size: 25)
config.redis = Redis::Config.sidekiq
end
Sidekiq.configure_server do |config|
config.redis = sidekiq_redis_config.merge(size: 25)
config.redis = Redis::Config.sidekiq
end