DEV: Migrate Sidekiq to a dedicated Redis DB

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).
This commit is contained in:
Loïc Guitaut
2025-02-19 17:59:55 +01:00
committed by Loïc Guitaut
parent 80625f6c1c
commit b9dd9c70a5
6 changed files with 76 additions and 6 deletions

View File

@ -1047,10 +1047,10 @@ module Discourse
SIDEKIQ_NAMESPACE = "sidekiq"
def self.sidekiq_redis_config
conf = GlobalSetting.redis_config.dup
conf[:namespace] = SIDEKIQ_NAMESPACE
conf
def self.sidekiq_redis_config(old: false)
redis_config = GlobalSetting.redis_config.dup
return redis_config.merge(namespace: SIDEKIQ_NAMESPACE) if old
redis_config.merge(db: redis_config[:db].to_i + 1)
end
def self.static_doc_topic_ids