But when I run the task on second time, it always throw AlreadyQueued exception. Seems like the key didn't been delete after this function ends.
So I create a class
class TestQueueOnce(QueueOnce):
and call get_key and print the key in apply_async and after_return
I found the key is different!
in after_return, the key is app.worker.analyze_tasks.calculate_something_args-()_kwargs-{}
in apply_async, the key is app.worker.analyze_tasks.calculate_something
I'm use celery_once=3.0.0 in my project.
I have a task like:
But when I run the task on second time, it always throw AlreadyQueued exception. Seems like the key didn't been delete after this function ends.
So I create a class
and call get_key and print the key in
apply_async
andafter_return
I found the key is different!
in after_return, the key is
app.worker.analyze_tasks.calculate_something_args-()_kwargs-{}
in apply_async, the key isapp.worker.analyze_tasks.calculate_something