5
如果一個任務失敗,整個鏈斷裂,Celery鏈的重點是什麼?如果其中一項任務失敗,將導致芹菜鏈中斷
我有這樣的芹菜鏈:
res = chain(workme.s (y=1111), workme2.s(2222), workme3.s(3333),)()
我做workme2失敗,這樣的重試次數:
@celery.task(default_retry_delay=5, max_retries = 10, queue="sure")
def workme2(x,y):
# try:
try:
print str(y)
sleep(2)
print str(x)
## adding any condition that makes the task fail
if x!=None:
raise Exception('Aproblem from your workme task')
print 'This is my username: ' + str(x['user']) + \
' And Password: ' + str(x['pas'])
return "22xx"
except Exception, exc:
workme2.retry(args=[x,y], exc=exc,)
http://stackoverflow.com/questions/11508112/retrying-celery-failed-tasks-that-are-part-of-a-chain –
@BernhardVallant,嗨,我在幾天前下載了最新版本,這是否意味着這個補丁不包括在內? – securecurve
如果它比3.0.4更新,我想它應該包括在內... –