Conversation
|
Thanks for the PR! I’m not the maintainer, but I did want to note that this use case may already be covered via a dead letter queue. For keeping failed jobs around for debugging, or manual reprocessing, DLQs already preserve the payload and failure output while not changing the source queue’s retention behavior. If the goal here is to prune successful jobs while retaining failed source rows, maybe that would fit better as a per-queue retention option instead of a constructor flag? |
|
Thanks for the thoughtful review @blue2cat You're right that DLQs cover a good chunk of this — with the What I'm after is slightly different though: keeping the original failed rows That said, I agree the per-queue suggestion is the better shape — especially since
This would be symmetrical with the existing API and lets users prune completed Does that sound reasonable? Happy to adjust before pushing the rework. |
I agree with switching away from a new constructor option, but I'm hesitant to add another option that encourages manual intervention to prevent a maintenance issue, such as a table that can never remove its data.
What if you were to create a single DLQ that catches failures from all of your queues? It would only require a one-time retention configuration in that case. There are probably plenty of reasons to not do this, but it may work if your failure rates are under control. |
|
Another option you can do is use I'll go ahead and close this now as it's a bit stale. |
Adds a new boolean configuration flag (e.g. deleteFailedJobs) that controls whether failed jobs are included in the supervisor's retention cleanup.
When the flag is true (default), behavior is unchanged — both completed and failed jobs are deleted per the retention policy.
When the flag is false, the supervisor only deletes completed jobs, and failed jobs are kept in the table for debugging, auditing, and manual reprocessing.