Fail task if no peer left to try
This commit is contained in:
parent
8bf17d3a69
commit
62d4edadf6
1 changed files with 3 additions and 0 deletions
|
@ -539,6 +539,9 @@ class WorkerManager(object):
|
||||||
self.tasks.updateItem(task, "workers_num", task["workers_num"] - 1)
|
self.tasks.updateItem(task, "workers_num", task["workers_num"] - 1)
|
||||||
else:
|
else:
|
||||||
task["workers_num"] -= 1
|
task["workers_num"] -= 1
|
||||||
|
if len(task["failed"]) >= len(self.workers):
|
||||||
|
fail_reason = "Too many fails: %s (workers: %s)" % (len(task["failed"]), len(self.workers))
|
||||||
|
self.failTask(task, reason=fail_reason)
|
||||||
|
|
||||||
# Wait for other tasks
|
# Wait for other tasks
|
||||||
def checkComplete(self):
|
def checkComplete(self):
|
||||||
|
|
Loading…
Reference in a new issue