sorentwo / oban

💎 Robust job processing in Elixir, backed by modern PostgreSQL and SQLite3
https://getoban.pro
Apache License 2.0
3.17k stars 297 forks source link

Add support for only: [{job_status}] configuration in Oban.Plugins.Pruner #1084

Closed punchcafe closed 1 month ago

punchcafe commented 1 month ago

Hello!

We've recently adopted Oban (it's great so far, so thanks!) and are looking at ways to manage our dead letter queue for discarded jobs.

This PR would add the ability to specify which finished status to prune in the Basic Pruner, which would make dead lettering fairly trivial for projects which don't expect massive amounts of discards.

sorentwo commented 1 month ago

Thanks for the PR, but the basic pruner is purposefully bare bones. As noted in the Oban.Plugins.Pruner docs:

This plugin limited to a fixed interval and a single max_age check for all jobs. To prune on a cron-style schedule, retain jobs by a limit or age, or provide overrides for specific queues, workers, and job states; see Oban Pro's DynamicPruner.