Fix disabling of interval cleanups #768
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows
cleanup_interval_jobs
andcleanup_interval_seconds
to each be disabled by setting tonil
orfalse
. Since v3.0.0 (see #545), both would fallback to the default values.Since disabling these worked in v2.x and
CleanupTracker
still allowsnil
, it seems this was an accidental regression. Tests added accordingly.The ENV variable equivalents may also be disabled by setting to an empty string:
env GOOD_JOB_CLEANUP_INTERVAL_JOBS= good_job ...
This was already true, but is now tested.
The primary use-case is to allow one cleanup interval to be used, with the other disabled (that's the case here).
If both are set to
nil
, then auto cleanup is disabled. In light of the recent change to always preserve cron jobs (#767), that could be bad. However, setting both tonil
does allow intentionally running cleanup externally, which may be a useful configuration for some. Accordingly, no attempt has been made to prevent both being disabled.Finally, tagged on an update to ensure macOS on Intel can use precompiled versions of gems like
nokogiri
. I don't know if you prefer having such housekeeping tasks as separate PRs or not. Happy to split off if needed.