NicolasLM / spinach

Modern Redis task queue for Python 3
https://spinach.readthedocs.io
BSD 2-Clause "Simplified" License
63 stars 4 forks source link

Make the Redis broker clean up aborted jobs #23

Closed 0xDEC0DE closed 2 years ago

0xDEC0DE commented 2 years ago

The Redis broker uses a non-zero value for max_retries to determine if it should remove a job from the "running" state. So when an AbortException is thrown, max out the job.retries counter, rather than zeroing out the job.max_retries counter. This will have the same effect, but play more nicely with what the Redis broker is expecting.

The MemoryBroker is unaffected by this.

Fixes Issue #20

0xDEC0DE commented 2 years ago

For reference: https://github.com/NicolasLM/spinach/blob/master/spinach/brokers/redis.py#L229-L236