option for silencing logging for heartbeats#389
option for silencing logging for heartbeats#389jlvallelonga wants to merge 1 commit intorails:mainfrom
Conversation
|
Thanks @jlvallelonga! However, I was hoping we could get #210 done instead of having a bunch of different options to silence different parts 😅 |
|
Yeah I was thinking about that a bit when I was doing this. Makes sense :) |
|
For me, |
|
In the meantime, I've monkeypatched this PR: # /config/initializers/solid_queue.rb
module SilenceHeartbeat
def heartbeat
ActiveRecord::Base.logger.silence do
# Clear any previous changes before locking, for example, in case a previous heartbeat
# failed because of a DB issue (with SQLite depending on configuration, a BusyException
# is not rare) and we still have the unpersisted value
restore_attributes
with_lock { touch(:last_heartbeat_at) }
end
end
end
Rails.application.config.to_prepare do
SolidQueue::Process.prepend(SilenceHeartbeat) unless Rails.env.production?
endMany tnx @jlvallelonga |
|
That work's great Jean-Baptiste to silence the heartbeat logging that happens every minute. You can also significantly reduce the 5-minute "Prune dead processes" logs by adding to But I've found that bad things happen if you try to get rid if the 10-minute "Unblock jobs" logging by any setting of |
|
Whats holding up this merge? |
|
@yelvert, basically #389 (comment) |
Broadens the existing `silence_polling` config option into a unified `silence_queries` that silences all of Solid Queue's internal SQL logging — not just polling, but also heartbeats, concurrency maintenance, process pruning, and scheduler dynamic task reloading. This addresses the long-standing request in rails#210 and aligns with the direction outlined in rails#389 (review comment): a single toggle instead of accumulating per-feature silencing flags. `silence_polling` remains as a backward-compatible alias.
Replace `silence_polling` with a unified `silence_queries` config that silences all of Solid Queue's internal SQL logging: polling, heartbeats, concurrency maintenance, process pruning, and scheduler dynamic task reloading. This implements the approach approved by @rosa in rails#198 and addresses the long standing request in rails#210: a single toggle instead of accumulating per feature silencing flags (rails#389). `silence_polling` remains as a backward compatible alias.
In development, and possible other environments, it's sometimes nice to not see the heartbeat logging. This adds an option to silence the logging for heartbeats. It's very similar to the "silence_polling" option.
Usage: