Skip to content
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

GoodJob.cleanup_preserved_jobs: add :include_discarded option #1550

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonleighton
Copy link

This change allows the caller of GoodJob.cleanup_preserved_jobs to specify the :include_discarded option, rather than always relying on the value that is set in the configuration.

This would enable us to e.g. set config.cleanup_preserved_jobs_before_seconds_ago to a very low value (e.g. 10 seconds), but also set config.cleanup_discarded_jobs = false so that we can retain discarded jobs for longer in case we want to inspect them or manually retry then.

We would then set up a separate maintenance job to call GoodJob.cleanup_preserved_jobs(older_than: some_longer_period, include_discarded: true).

@jonleighton
Copy link
Author

Note that it was proving difficult to get the tests running in my local dev environment, so I hoped to push this up and run it on your CI.

This change allows the caller of GoodJob.cleanup_preserved_jobs to
specify the :include_discarded option, rather than always relying on the
value that is set in the configuration.

This would enable us to e.g. set
config.cleanup_preserved_jobs_before_seconds_ago to a very low value
(e.g. 10 seconds), but also set config.cleanup_discarded_jobs = false so
that we can retain discarded jobs for longer in case we want to inspect
them or manually retry then.

We would then set up a separate maintenance job to call
GoodJob.cleanup_preserved_jobs(older_than: some_longer_period,
include_discarded: true).
@jonleighton
Copy link
Author

I realised that this project is setup for devcontainers and managed to run and fix the tests locally, so hopefully CI will pass now.

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

Successfully merging this pull request may close these issues.

1 participant