demarches-normaliennes/config/initializers/transition_to_sidekiq.rb
2024-03-26 21:25:14 +01:00

29 lines
745 B
Ruby

sidekiq_enabled = ENV.has_key?('REDIS_SIDEKIQ_SENTINELS') || ENV.has_key?('REDIS_URL')
if Rails.env.production? && sidekiq_enabled
ActiveSupport.on_load(:after_initialize) do
class ActiveStorage::PurgeJob < ActiveStorage::BaseJob
self.queue_adapter = :sidekiq
end
class VirusScannerJob
self.queue_adapter = :sidekiq
end
class DossierRebaseJob < ApplicationJob
self.queue_adapter = :sidekiq
end
class ProcedureExternalURLCheckJob < ApplicationJob
self.queue_adapter = :sidekiq
end
class MaintenanceTasks::TaskJob
self.queue_adapter = :sidekiq
end
class PriorizedMailDeliveryJob < ActionMailer::MailDeliveryJob
self.queue_adapter = :sidekiq
end
end
end