Skip to content

How to suppress repetitive logs in development? #658

Closed
@sedubois

Description

This gets printed every 10 seconds in my development environment:

  GoodJob::Execution Load (0.6ms)  SELECT "good_jobs".* FROM "good_jobs" WHERE "good_jobs"."id" IN (WITH "rows" AS MATERIALIZED ( SELECT "good_jobs"."id", "good_jobs"."active_job_id" FROM "good_jobs" WHERE "good_jobs"."finished_at" IS NULL AND ("good_jobs"."scheduled_at" <= '2022-07-10 08:44:41.505487' OR "good_jobs"."scheduled_at" IS NULL) ORDER BY priority DESC NULLS LAST ) SELECT "rows"."id" FROM "rows" WHERE pg_try_advisory_lock(('x' || substr(md5('good_jobs' || '-' || "rows"."active_job_id"::text), 1, 16))::bit(64)::bigint) LIMIT $1) ORDER BY priority DESC NULLS LAST  [["LIMIT", 1]]
  GoodJob::Lockable Unlock Session (0.2ms)  SELECT pg_advisory_unlock_all()::text AS unlocked

It's mentioned in #455 (comment) that there shouldn't be any polling, however AFAIK I didn't configure anything specific in this regard, here is my initializer:

Rails.application.configure do
  config.good_job.preserve_job_records = true
  config.good_job.retry_on_unhandled_error = false
  config.good_job.on_thread_error = -> (exception) do
    Sentry.set_extras(good_job_on_thread_error: true)
    Sentry.capture_exception(exception)
  end
end

ActionMailer::MailDeliveryJob.retry_on StandardError,
                                       wait: :exponentially_longer, attempts: Float::INFINITY
ActionMailer::MailDeliveryJob.around_perform do |_job, block|
  block.call
rescue StandardError => e
  Sentry.set_extras(action_mailer_standard_error: true)
  Sentry.capture_exception(e)
  raise
end

How can the polling be disabled, or what is otherwise the recommended way to avoid those repetitive logs while developing?

Using Rails 7.0.3, GoodJob 3.0.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions