arq icon indicating copy to clipboard operation
arq copied to clipboard

redis-py complains about `pool.close` and wants `pool.aclose`

Open ramnes opened this issue 8 months ago • 1 comments

Hey there, thanks for the neat project!

Using Worker.close gives a warning with redis-py >= 5.0.1:

  .venv/lib/python3.10/site-packages/arq/worker.py:846: DeprecationWarning: Call to deprecated close. (Use aclose() instead) -- Deprecated since version 5.0.0.
    await self.pool.close(close_connection_pool=True)

Should be pretty straightforward to fix if older versions of redis-py get dropped, otherwise something like if hastattr(self.pool, "aclose"): self.pool.aclose() should work, I guess.

Happy to follow instructions and make the PR if needed. :)

ramnes avatar Nov 02 '23 15:11 ramnes