0
0
Fork 0

Refactor (ruby) redis configuration (#31694)

This commit is contained in:
David Roetzel 2024-09-02 16:19:55 +02:00 committed by GitHub
parent a23b3747ac
commit 388d5473e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 295 additions and 90 deletions

View file

@ -40,7 +40,7 @@ module Mastodon
.dup
.tap { |config| config['pool'] = options[:concurrency] + 1 }
)
RedisConfiguration.establish_pool(options[:concurrency])
RedisConnection.establish_pool(options[:concurrency])
end
end
end

View file

@ -51,7 +51,7 @@ module Mastodon::CLI
result = ActiveRecord::Base.connection_pool.with_connection do
yield(item)
ensure
RedisConfiguration.pool.checkin if Thread.current[:redis]
RedisConnection.pool.checkin if Thread.current[:redis]
Thread.current[:redis] = nil
end