python-arq / arq

Fast job queuing and RPC in python with asyncio and redis.
https://arq-docs.helpmanual.io/
MIT License
2.09k stars 173 forks source link

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

Open ramnes opened 10 months ago

ramnes commented 10 months ago

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. :)

Wh1isper commented 3 months ago

We can either upgrade directly when dropping redis v4 support or, as you metioned, trying the new method first👍

Kludex commented 1 month ago

This would help us as well.