celery-once icon indicating copy to clipboard operation
celery-once copied to clipboard

Only delay and apply_async check against the lock.

Open sogloarcadius opened this issue 5 years ago • 1 comments

Hello,

I am struglling to make celery-once check against the lock when using celery.send_task. Can you explain me the reason why it fails to check against the lock when using send_task ? Is it possible to add this feature to the library ?

I am making the flower rest api available to the end users to make calls to my tasks and it would be great if celery_once could prevent calling the task when using send_task endpoint ?

Thanks,

Regards

sogloarcadius avatar Dec 27 '19 13:12 sogloarcadius

Hey @sogloarcadius this is probably late for you, but in case someone else finds this you can use a signature instead of send_task.

It works similar to send_task, here's an example:

from celery import signature

signature("task.name", (arg1, arg2), countdown=60,).apply_async()

frankV avatar Sep 20 '20 20:09 frankV