demarches-normaliennes/config/initializers/transition_to_sidekiq.rb
simon lehericey 40df5028ff
chore: move more jobs to sidekiq
active_storage_analysis : queue active_storage_analysis
proceduresvasvr: queue sva
webhook: queue webhooks_v1
destroyrecordlater: default
champfetchexternal: default
dossierupdatesearch: default
2024-03-28 17:25:50 +01:00

53 lines
1.3 KiB
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 ActiveStorage::AnalyzeJob < 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
class ProcedureSVASVRProcessDossierJob < ApplicationJob
self.queue_adapter = :sidekiq
end
class WebhookJob < ApplicationJob
self.queue_adapter = :sidekiq
end
class DestroyRecordLaterJob < ApplicationJob
self.queue_adapter = :sidekiq
end
class ChampFetchExternalDataJob < ApplicationJob
self.queue_adapter = :sidekiq
end
class DossierUpdateSearchTermsJob < ApplicationJob
self.queue_adapter = :sidekiq
end
end
end