Increase celery retry time each retry cycle

后端 未结 3 672
野的像风
野的像风 2020-12-28 18:46

I do retries with celery like in the Docs-Example:

@task()
def add(x, y):
    try:
        ...
    except Exception, exc:
        add.retry(exc=exc, countdow         


        
3条回答
  •  有刺的猬
    2020-12-28 19:25

    Since version 4.2 you can use options autoretry_for and retry_backoff for this purposes, for example:

    @task(max_retries=10, autoretry_for=(Exception,), retry_backoff=60)
    def add(x, y):
        pass
    

提交回复
热议问题