简体   繁体   中英

Celery gives no error with bad remote task names, why?

Using "send_task" celery actually never verifies a remote task exists ie:

app.send_task('tasks.i.dont.exist', args=[], kwargs={})

Celery seems to still return a message ie:

<AsyncResult: b8c1425a-7411-491f-b75a-34313832b8ba>

Is there a way for it to fail if the remote task does not exist?

I've tried adding .get() and it just freezes.

According to the documentation:

If the task is not registered in the current process then you can also execute a task by name.

You do this by using the send_task() method of the celery instance

If you want verification consider using delay instead.

You can read more about how to execute celery tasks here .

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