feat: add QUEUE_JOB_RETENTION_AGE_SECONDS to environment configuration #921
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.
Introduced a new environment variable QUEUE_JOB_RETENTION_AGE_SECONDS to define the age (in seconds) after which completed or failed jobs are eligible for removal. Updated job options to utilize this variable for job retention settings.
PR-Codex overview
This PR focuses on updating job retention configurations in the
queues.ts
file to use environment variables for job age retention instead of hardcoded values. It also adds a new environment variable for job retention age inenv.ts
.Detailed summary
In
src/worker/queues/queues.ts
:removeOnComplete
andremoveOnFail
to useenv.QUEUE_JOB_RETENTION_AGE_SECONDS
instead of a hardcoded value of 7 days.In
src/shared/utils/env.ts
:QUEUE_JOB_RETENTION_AGE_SECONDS
.QUEUE_JOB_RETENTION_AGE_SECONDS
environment variable to the exportedenv
object.Summary by CodeRabbit
New Features
Chores