mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:13:39 +08:00

As we’re currently using a namespace for Sidekiq, in order to upgrade to the latest version, we need to drop it as it’s not supported anymore. The recommended way is to use a different Redis DB for Sidekiq. This patch uses a different config for Sidekiq and also takes care of migrating existing jobs (in queues and the retry and scheduled sets).
15 lines
380 B
Ruby
15 lines
380 B
Ruby
# frozen_string_literal: true
|
|
|
|
# TODO (2025-03-03): delete this once the migration is propagated everywhere
|
|
# (in about 6 months or so)
|
|
module Sidekiq
|
|
def self.redis_pool
|
|
@redis ||= RedisConnection.create
|
|
Thread.current[:sidekiq_via_pool] || @redis
|
|
end
|
|
|
|
def self.old_pool
|
|
@old_pool ||= RedisConnection.create(Discourse.sidekiq_redis_config(old: true))
|
|
end
|
|
end
|