mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 08:00:01 +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).
16 lines
570 B
Ruby
16 lines
570 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Multisite freedom patch defines RailsMultisite::DiscoursePatches.config which is used by 200-first_middlewares.rb
|
|
# Therefore it can not be postponed with .to_prepare
|
|
RUN_WITHOUT_PREPARE = [
|
|
"#{Rails.root}/lib/freedom_patches/rails_multisite.rb",
|
|
"#{Rails.root}/lib/freedom_patches/sidekiq.rb",
|
|
]
|
|
RUN_WITHOUT_PREPARE.each { |path| require(path) }
|
|
|
|
Rails.application.reloader.to_prepare do
|
|
Dir["#{Rails.root}/lib/freedom_patches/*.rb"].each do |f|
|
|
next if RUN_WITHOUT_PREPARE.any? { |path| path == f }
|
|
require(f)
|
|
end
|
|
end
|