tobymao / saq

Simple Async Queues
https://saq-py.readthedocs.io/en/latest/
MIT License
583 stars 41 forks source link

Fix: Recover from bad Postgres connection #163

Closed vchan closed 1 month ago

vchan commented 2 months ago

Fixes #162

A bad queue.connection will cause the worker to hang. This PR checks queue.connection when it is about to be used and replaces it with a new one from the pool if it's bad. There is a caveat regarding the active jobs of the worker using the queue. The worker no longer holds the advisory locks for those active jobs so they will be swept.