0
0
Fork 0

Add retention policy for cached content and media (#19232)

This commit is contained in:
Eugen Rochko 2022-09-27 03:08:19 +02:00 committed by GitHub
parent 3e0999cd11
commit 5c9abdeff1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 559 additions and 135 deletions

View file

@ -7,9 +7,7 @@ class RedisConfiguration
@pool = ConnectionPool.new(size: new_pool_size) { new.connection }
end
def with
pool.with { |redis| yield redis }
end
delegate :with, to: :pool
def pool
@pool ||= establish_pool(pool_size)
@ -17,7 +15,7 @@ class RedisConfiguration
def pool_size
if Sidekiq.server?
Sidekiq.options[:concurrency]
Sidekiq[:concurrency]
else
ENV['MAX_THREADS'] || 5
end