Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[dashboard] Confusion between preserve_job_records and data on dashboard #1602

Open
francois opened this issue Feb 11, 2025 · 1 comment
Open

Comments

@francois
Copy link

Our config/application.rb contains the following line:

config.good_job.preserve_job_records = false

The job itself is declared thusly:

class DetectBundleExtensionJob < ApplicationJob
  # @TODO: While we are migrating from Sidekiq, declare individual queue adapters where needed
  self.queue_adapter = :good_job

  retry_on StandardError, attempts: 0

  def perform(inspection_id)
    # implementation
  end
end

How come the dashboard shows completed jobs? I mean the navbar/page header as well as the list of jobs at the bottom.

Image

In the end, we want to preserve jobs for a bit, but we had an issue (unrelated to GoodJob) and we haven't reset our config to preserve records yet.

@bensheldon
Copy link
Owner

Weird! I'm not sure why that would be. preserve_job_records is checked when the job execution finishes:

preserve_unhandled = result.unhandled_error && (GoodJob.retry_on_unhandled_error || GoodJob.preserve_job_records == :on_unhandled_error)
if finished_at.blank? || GoodJob.preserve_job_records == true || reenqueued || preserve_unhandled || cron_key.present?
transaction do
execution.save!
save!
end
else
destroy!
end

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Inbox
Development

No branches or pull requests

2 participants