demarches-normaliennes/config/initializers/transition_to_sidekiq.rb

10 lines
291 B
Ruby
Raw Normal View History

2023-11-13 10:52:45 +01:00
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
end
end