Provide clearer values/deprecation notices for cleanup_interval_jobs
and cleanup_interval_seconds
; setting 0
disables, -1
always
#776
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.
Per #768, this PR adds deprecation notices for certain values of
cleanup_interval_jobs
andcleanup_interval_seconds
.Right now,
1
,0
, and any negative value are equivalent forcleanup_interval_jobs
.Likewise,
0
and any negative value are equivalent forcleanup_interval_seconds
. These values also cause behavior identical tocleanup_interval_jobs: 1
which is mildly counter-intuitive to my mind. If cleaning on every job is wanted, it should be configured usingcleanup_interval_jobs
, notcleanup_interval_seconds
.Long term, I'll suggest that each setting should be considered disabled for values of
false
(ruby only) or<= 0
(both ruby and ENVs). This supports use of-1
as used elsewhere in GoodJob, and for ENVs in particular, respects the common use of=0
to disable.Included in this PR to get from here to there:
nil
are deprecated and will suggestfalse
.<= 0
are deprecated and will suggest1
.+""
are deprecated and will suggest-1
.0
are deprecated and will suggest1
.+<= -1
are immediately changed from behaving like1
to instead disabling.+For
cleanup_interval_seconds
, these will suggest changing tocleanup_interval_jobs=1
.Regarding (5), without this change, it's difficult to know what action to suggest in the deprecation notice. The only existing mechanism to disable via ENV is
""
which we also want to deprecate. I highly doubt-1
is being used to intentionally enable these settings, so hoping it's tolerable to change now.Feedback welcome if this overreaches in any area.