Files
discourse/lib/freedom_patches/sidekiq.rb
Loïc Guitaut b9dd9c70a5 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).
2025-03-03 15:42:26 +01:00

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