procrastinate-org / procrastinate

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

Redo wrap_exception and add one for the Django Connector #1014

Closed ewjoachim closed 5 months ago

ewjoachim commented 5 months ago

Closes #981

Django connector was missing an exception mapper transforming Psycopg (2 or 3) exceptions to procrastinate exception, especially the queueing lock exception that we handle gracefully.

In order to make a proper implementation, I redid wrap_exceptions everywhere using contextlib.contextmanager.

Successful PR Checklist:

PR label(s):

github-actions[bot] commented 5 months ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  procrastinate
  psycopg_connector.py
  sync_psycopg_connector.py
  utils.py
  procrastinate/contrib/aiopg
  aiopg_connector.py
  procrastinate/contrib/django
  django_connector.py
  procrastinate/contrib/psycopg2
  psycopg2_connector.py
  procrastinate/contrib/sqlalchemy
  psycopg2_connector.py
Project Total  

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