From c9da516af6483b24e221292cc0d6a4192437f740 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Sat, 16 Jan 2021 13:22:15 -0500 Subject: [PATCH] Update hiredis driver and add a default REDIS_POOL_SIZE --- Gemfile | 2 +- Gemfile.lock | 2 +- config/initializers/redis.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 143a8105..0de8faf1 100644 --- a/Gemfile +++ b/Gemfile @@ -70,7 +70,7 @@ gem 'rack-attack', '~> 6.0' gem 'rack-cors', '~> 1.0', require: 'rack/cors' gem 'rails-i18n', '~> 5.1' gem 'rails-settings-cached', '~> 0.6' -gem 'redis', '~> 4.1', require: ['redis', 'redis/connection/hiredis'] +gem 'redis', '~> 4.2', require: ['redis', 'redis/connection/hiredis'] gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock' gem 'rqrcode', '~> 0.10' gem 'sanitize', '~> 5.0' diff --git a/Gemfile.lock b/Gemfile.lock index 4aacc615..e8dff848 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -754,7 +754,7 @@ DEPENDENCIES rails-settings-cached (~> 0.6) rdf-normalize (~> 0.3) redcarpet (~> 3.4) - redis (~> 4.1) + redis (~> 4.2) redis-namespace (~> 1.5) redis-rails (~> 5.0) rqrcode (~> 0.10) diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb index 0ae37b6a..ca1fd54f 100644 --- a/config/initializers/redis.rb +++ b/config/initializers/redis.rb @@ -3,7 +3,7 @@ require 'connection_pool' -redis_connection = ConnectionPool::Wrapper.new(size: ENV['REDIS_POOL_SIZE'], timeout: 10) { Redis.new( +redis_connection = ConnectionPool::Wrapper.new(size: ENV['REDIS_POOL_SIZE'] || 5, timeout: 10) { Redis.new( url: ENV['REDIS_URL'], driver: :hiredis )}