Return the Celery worker's DB connection to a clean state after ORM errors.
()
| 46 | |
| 47 | |
| 48 | def _release_task_db_connection(): |
| 49 | """Return the Celery worker's DB connection to a clean state after ORM errors.""" |
| 50 | from django.db import close_old_connections |
| 51 | close_old_connections() |
| 52 | |
| 53 | |
| 54 | def _db_query_with_retry(fn, *, label="DB query", max_retries=2): |
no outgoing calls
no test coverage detected