简体   繁体   中英

Celery task delay calling convention in 4.2.0

I recently upgraded celery from version 4.0.2 to 4.2.0 , the following was working prior to upgrading and I can't find what I need to change to make it work on the latest.

Example:

@task
def run_mytask(pk):
    print pk

task = tasks.run_mytask.delay(pk)

Now throws the following error:

TypeError: unbound method shadow_name() must be called with run_mytask instance as first argument (got tuple instance instead)

It appears the issue was fixed in celery#4572 .

As discussed in comments, pulling down the latest version and installing celery with this change resolves this issue for you, since your version did not contain these changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM