fix: Gate Sidekiq dequeue logger behind env (#12790)

## Summary
- wrap the dequeue middleware registration in a boolean env flag
- document the ENABLE_SIDEKIQ_DEQUEUE_LOGGER option in .env.example
This commit is contained in:
Sojan Jose
2025-11-04 16:01:47 -08:00
committed by GitHub
parent 40c75941f5
commit e8ae73230d
2 changed files with 6 additions and 2 deletions

View File

@@ -256,6 +256,8 @@ AZURE_APP_SECRET=
## Change these values to fine tune performance
# control the concurrency setting of sidekiq
# SIDEKIQ_CONCURRENCY=10
# Enable verbose logging each time a job is dequeued in Sidekiq
# ENABLE_SIDEKIQ_DEQUEUE_LOGGER=false
# AI powered features

View File

@@ -18,8 +18,10 @@ end
Sidekiq.configure_server do |config|
config.redis = Redis::Config.app
config.server_middleware do |chain|
chain.add ChatwootDequeuedLogger
if ActiveModel::Type::Boolean.new.cast(ENV.fetch('ENABLE_SIDEKIQ_DEQUEUE_LOGGER', false))
config.server_middleware do |chain|
chain.add ChatwootDequeuedLogger
end
end
# skip the default start stop logging