celery-singleton
celery-singleton copied to clipboard
Doesn't work with bind=True and self arg
I get TypeError missing a required argument: 'user_pk', where user_pk is the last argument of the task:
@shared_task(bind=True, base=Singleton, unique_on=["some_pk"], lock_expiry=15 * 60, acks_late=True)
def do_stuff(self, some_pk, user_pk):
# ...
The bug is in:
celery_singleton/singleton.py in generate_lock at line 64
bound = sig.bind(*task_args, **task_kwargs).arguments
Any workaround found so far?