Answer the question
In order to leave comments, you need to log in
What's wrong with celery_self?
I don't understand why it works for me like this
@celery.task(bind=True)
def task_first():
pass
@celery.task(bind=True)
def task_second():
pass
missing 1 required positional argument: 'celery_self'
Answer the question
In order to leave comments, you need to log in
Correctly, if bind=True is already specified, then it is assumed that your task will use an instance task, which means that the function receives self as the first argument. It is very strange that it worked differently for you, maybe there were some decorators?
According to the docs, this is how it should work.
@celery.task(bind=True)
def task_first(self):
pass
@celery.task()
def task_second():
pass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question