【发布时间】:2018-12-24 23:03:41
【问题描述】:
如果失败,我正在尝试重试 celery 任务。这是我的任务,
@shared_task(queue='es', bind=True, max_retries=3)
def update_station_es_index(doc_id, doc_body):
"""
Celery consumer method for updating ES.
"""
try:
#es_client is connecting to ElasticSearch
es_client.update_stations(id=doc_id, body=doc_body)
except Exception as e:
self.retry(exc=e)
但调用此任务时出现此错误,
TypeError: update_station_es_index() takes 2 positional arguments but 3 were given
我没有在网上找到足够的帮助来解决这个错误,只是this github issue,但这并不能解释太多。
谁能告诉我发生了什么以及这里的解决方案是什么?
使用 Django2.0.5 和 celery4.2.0
【问题讨论】:
标签: python django django-celery