celery-php
celery-php copied to clipboard
request.retries comes in as null in the celery worker
I'm trying to retry tasks if they fail, using a back-off mechanism:
self.retry(exc=e, countdown=int(random.uniform(2, 4) ** self.request.retries))
When sending tasks from Python's celery, everything works well. Using celery-php to send tasks throws an error when reaching the code above, saying that self.request.retries
is None
.
Python's celery automatically sends request.retries
as 0 on the first schedule of the task.
I am also trying to implement the retry and having the same issue.
@edu2004eu did you have any progress on the following issue?
I am checking whether request.retries
is set in the worker, and if not, I set it to 0. My worker is Python, so I have:
if self.request.retries is None:
self.request.retries = 0
self.retry(exc=e, countdown=int(random.uniform(2, 4) ** self.request.retries))