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

Doesn't work with bind=True and self arg

Open Suor opened this issue 5 years ago • 1 comments

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

Suor avatar Sep 09 '20 13:09 Suor

Any workaround found so far?

elavaud avatar Feb 23 '23 03:02 elavaud