celery-php
celery-php copied to clipboard
CELERY_TRACK_STARTED breaks get()
Hi,
After much head scratching, I finally figured out why my 'get' was not returning results.
It turns out that ff the Celery worker is configured with
CELERY_TRACK_STARTED = True
CELERY_RESULT_BACKEND = 'amqp'
the task status changes to 'STARTED', but never moves to ''SUCCESS'. (at least for me!). So using .get() never returns a result
Changing to
CELERY_TRACK_STARTED = False
and switching to PHP AMQP implementation (so that I can expire the results), solved all my headaches.
Thanks for a very useful script!
Nice catch. For now I just added this to readme: https://github.com/gjedeer/celery-php/commit/4049a6038a1b4a08843cc245a8171675f1161bd7 I'll leave this bug open, will try to figure it out next time I have time to work on this library.
One other note that may be useful to include in the README is the CELERY_RESULT_BACKEND
setting recommendation. Otherwise, it seems like failures don't report quite as you'd expect (took me a bit to figure out...). My tasks would just wait forever if I was polling them for a change since the result wasn't recorded.