diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-05-01 18:24:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-01 18:24:42 +0200 |
commit | a41b3d0457451abf750ecd2e5576e4d516d8ab95 (patch) | |
tree | 9e2238c87c72ef0bdca8159e4beb886553cd8755 /app/lib/redis_configuration.rb | |
parent | 252deefe3433d0cedafd973becd0d85b5182eb49 (diff) | |
parent | 26a51291c74e7f27bf5e97bec9cd415d7ed48246 (diff) |
Merge pull request #1760 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/lib/redis_configuration.rb')
-rw-r--r-- | app/lib/redis_configuration.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/lib/redis_configuration.rb b/app/lib/redis_configuration.rb index fc8cf2f80..e14d6c8b6 100644 --- a/app/lib/redis_configuration.rb +++ b/app/lib/redis_configuration.rb @@ -2,12 +2,17 @@ class RedisConfiguration class << self + def establish_pool(new_pool_size) + @pool&.shutdown(&:close) + @pool = ConnectionPool.new(size: new_pool_size) { new.connection } + end + def with pool.with { |redis| yield redis } end def pool - @pool ||= ConnectionPool.new(size: pool_size) { new.connection } + @pool ||= establish_pool(pool_size) end def pool_size |