Skip to content

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Jul 27, 2025

Here, let each of the job cleaner's configured retention periods
(CancelledJobRetentionPeriod, CompletedJobRetentionPeriod,
DiscardedJobRetentionPeriod) accept the special value of -1 so that
the cleaner will maintain that type of job indefinitely, effectively
disabling it.

This probably won't be of much use day-to-day for most users, but does
enable us to augment cleaning functionality with special overrides.

@brandur brandur force-pushed the brandur-retain-indefinitely branch 2 times, most recently from d059eee to 851693c Compare July 27, 2025 15:52
…definitely

Here, let each of the job cleaner's configured retention periods
(`CancelledJobRetentionPeriod`, `CompletedJobRetentionPeriod`,
`DiscardedJobRetentionPeriod`) accept the special value of -1 so that
the cleaner will maintain that type of job indefinitely, effectively
disabling it.

This probably won't be of much use day-to-day for most users, but does
enable us to augment cleaning functionality with special overrides.
@brandur brandur force-pushed the brandur-retain-indefinitely branch from 851693c to c46081a Compare July 27, 2025 15:53
Copy link
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Breaking change:** The `HookWorkEnd` interface's `WorkEnd` function now receives a `JobRow` parameter in addition to the `error` it received before. Having a `JobRow` to work with is fairly crucial to most functionality that a hook would implement, and its previous omission was entirely an error. [PR #970](https://github.com/riverqueue/river/pull/970).
- Add maximum bound to each job's `attempted_by` array so that in degenerate cases where a job is run many, many times (say it's snoozed hundreds of times), it doesn't grow to unlimited bounds. [PR #974](https://github.com/riverqueue/river/pull/974).
- A logger passed in via `river.Config` now overrides the default test-based logger when using `rivertest.NewWorker`. [PR #980](https://github.com/riverqueue/river/pull/980).
- Cleaner retention periods (`CancelledJobRetentionPeriod`, `CompletedJobRetentionPeriod`, `DiscardedJobRetentionPeriod`) can be configured to -1 to disable them so that the corresponding type of job is retained indefinitely. [PR #990](https://github.com/riverqueue/river/pull/990).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably warrants a doc addition to https://riverqueue.com/docs/maintenance-services#cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a note of it for when we do a release.

@brandur
Copy link
Contributor Author

brandur commented Jul 27, 2025

Thanks!

@brandur brandur merged commit 517cde8 into master Jul 27, 2025
10 checks passed
@brandur brandur deleted the brandur-retain-indefinitely branch July 27, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants