-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quieting logs #55
Comments
You could pass in a proc that does nothing: https://github.com/veeqo/activejob-uniqueness/blob/main/lib/generators/active_job/uniqueness/templates/config/initializers/active_job_uniqueness.rb#L18 |
@bmulholland - sorry to not reply earlier. I missed your reply. We actually already tried that. Do you see something I am missing in our syntax? unique :until_and_while_executing,
lock_ttl: 1.hour,
on_conflict: ->(job) { logger.warn "Already in queue - not queueing again: #{job.arguments}" },
on_runtime_conflict: ->(job) { logger.warn "Already executing - not queueing again: #{job.arguments}" } Note that we tried it empty and had no output, and just on a whim moved it to this where we would at least see something if it started running the procs. Here is an example of the lines we still get in our logs: |
I should also call out that I know this is ActiveJob itself doing this - in fact I know the line of code is https://github.com/rails/rails/blob/13b3e7d83988d451ea305243319cc715a06617ea/activejob/lib/active_job/log_subscriber.rb#L93. But I was hoping there was an established wait to silence this would either a hacked logger or monkeypatching that subsciber. |
This might be more a doc issue than a code issue but...
The message ActiveJob gives when it does not enqueue something because of non-uniqueness is pretty nasty (
Failed enqueuing XXX to Sidekiq(default), a before_enqueue callback halted the enqueuing execution.
). Is there a way to silence that from the logs?The text was updated successfully, but these errors were encountered: