Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
This commit is contained in:
parent
9bf04db23a
commit
3917353645
44 changed files with 243 additions and 124 deletions
|
@ -1,14 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
redis_connection = Redis.new(
|
||||
url: ENV['REDIS_URL'],
|
||||
driver: :hiredis
|
||||
)
|
||||
|
||||
namespace = ENV.fetch('REDIS_NAMESPACE') { nil }
|
||||
|
||||
if namespace
|
||||
Redis.current = Redis::Namespace.new(namespace, redis: redis_connection)
|
||||
else
|
||||
Redis.current = redis_connection
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue