procrastinate-org / procrastinate

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

Allow to set a cache option when polling for an abortion request #1083

Open medihack opened 3 weeks ago

medihack commented 3 weeks ago

It might be easier for users if we implemented say def should_abort(cache=10) that would cache the answer for 10 seconds. This way, one may call the method as often as they wish. The default time could be a worker param.

_Originally posted by @ewjoachim in https://github.com/procrastinate-org/procrastinate/pull/1081#discussion_r1651403431_