procrastinate-org / procrastinate

PostgreSQL-based Task Queue for Python
https://procrastinate.readthedocs.io/
MIT License
840 stars 52 forks source link

feat: allow cleaning of cancelled and aborted jobs #1146

Closed katlyn closed 1 month ago

katlyn commented 1 month ago

Adds additional parameters to the builtin remove_old_jobs task to allow removing cancelled and aborted jobs in addition to failed and succeeded. Closes #1145.

Successful PR Checklist:

PR label(s):

github-actions[bot] commented 1 month ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  procrastinate
  manager.py
Project Total  

This report was generated by python-coverage-comment-action

medihack commented 1 month ago

Great, thanks a lot for the contribution! LGTM.

@ewjoachim Do you have something to add? Otherwise, I will merge it into the main branch and make a minor release. Also, how about renaming remove_error resp. include_error to remove_failed resp. include_failed for the v3 release? Would look a bit more consistent to me.

ewjoachim commented 1 month ago

Also, how about renaming remove_error resp. include_error to remove_failed resp. include_failed for the v3 release? Would look a bit more consistent to me.

Yup.

Also, we need to be more consistent in the docstrings regarding the argument types. I believe they're not needed and sphinx can read them from type annotations, but we should make sure of that and fix it everywhere.