Closed frol closed 6 years ago
Hello @frol
This won't work because reject_delay
argument is removed at version 9.
If you need that custom behavior I recommend implementing outside of Kuyruk.
@cenkalti What was the reasoning behind removing the existing functionality? Didn't it work?
There were exceptions coming from that part of code and it was too complex to understand and debug.
As a follow-up to #50, I want to share the code snippet I ended up using to implement infinite auto-retry for the crashing tasks with rescheduling the tasks back through RabbitMQ queue, which may help if the task will just get scheduled to a non-failing worker. I could not find a way to implement non-infinite auto-retry with rescheduling using RabbitMQ since you cannot update the existing task with some meta information (e.g. a number of failing attempts), but using some external service (e.g. Redis or Memcached), you can modify this code to implement any retry logic you want, so I leave it as an exercise to the reader to adapt the code snippet.
I had to override
inner
implementation of the Kuyruk class to pass mysafe_kuyruk_task
adapter, which enables the auto-retry logic for all the tasks automatically (thus, no changes to the existing tasks codebase is needed except this change of Kuyruk initialization).@cenkalti I couldn't find a good way to generalize this thing, so I won't send a PR, but I decided to share my code since other may wonder how to do that. It would be great to see some upstream solution to this problem either in form of some built-in implementation or just as an example/documentation somewhere.