Python 芹菜任务不正确地应用异步行为
调用下面的代码Python 芹菜任务不正确地应用异步行为,python,celery,Python,Celery,调用下面的代码 tasks.update_address_location.apply_async((address_obj.id), countdown = 10) 但是,任务会立即在队列上执行。我已经排除了其他的可能性。我想有人会有答案的 capp = Celery('async', backend='redis://localhost:6379/0', broker='redis://localhost:6379/0', include=['app.asyn
tasks.update_address_location.apply_async((address_obj.id), countdown = 10)
但是,任务会立即在队列上执行。我已经排除了其他的可能性。我想有人会有答案的
capp = Celery('async', backend='redis://localhost:6379/0',
broker='redis://localhost:6379/0', include=['app.async.tasks'])
# Optional configuration, see the application user guide.
capp.config_from_object(celeryconfig)
capp.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
)
if __name__ == '__main__':
capp.start()
芹菜被称为:
celery multi stop worker -A app.async.celery_app:capp --beat --loglevel=debug --pidfile=celery.pid --logfile=celery.log
Cellery.log中的输出是一致且成功的,但没有延迟。A的python-(x)==x
-一个包含一个元素的元组必须包含逗号-(x,)
这样做:
apply_async((address_obj.id,), {}, countdown=10)
也许可以尝试
…应用异步((address_obj.id,),{},countdown=10)
注意address_obj.id
后面的逗号,它似乎已经添加了work@scytale作为答案-如果对您有效,请接受它