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

Allow Scheduler to automatically clean up preserved jobs every N jobs or seconds #465

Merged
merged 1 commit into from
Dec 30, 2021

Conversation

bensheldon
Copy link
Owner

@bensheldon bensheldon commented Dec 4, 2021

This will be enabled by default in GoodJob 3.0.

The general idea is a garbage collector doing a sweep on a set interval: both number of jobs executed, and a time-based interval. The time-based interval is currently reliant on a job being executed i.e. the trigger for the time-based interval is a job being executed (there is not a separate cron-like process)

Adds two new configuration options:

  • cleanup_interval_jobs (integer) Number of jobs a Scheduler will execute before cleaning up preserved jobs. Defaults to nil. Can also be set with the environment variable GOOD_JOB_CLEANUP_INTERVAL_JOBS.
  • cleanup_interval_seconds (integer) Number of seconds a Scheduler will wait before cleaning up preserved jobs. Defaults to nil. Can also be set with the environment variable GOOD_JOB_CLEANUP_INTERVAL_SECONDS.

Uses the existing (but awkwardly named) cleanup_preserved_jobs_before_seconds_ago configuration option.

Closes #412

@bensheldon bensheldon temporarily deployed to goodjob-auto-cleanup-um7pdbwsw December 4, 2021 17:05 Inactive
@bensheldon bensheldon added the enhancement New feature or request label Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GoodJob should automatically clean up after itself and delete old job records
1 participant