Allow second peer for same task only if priority is above 10
This commit is contained in:
parent
8ba4201237
commit
1036d0e4a0
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ class WorkerManager(object):
|
|||
# Returns the next free or less worked task
|
||||
def getTask(self, peer):
|
||||
# Sort tasks by priority and worker numbers
|
||||
self.tasks.sort(key=lambda task: task["priority"] - task["workers_num"] * 5, reverse=True)
|
||||
self.tasks.sort(key=lambda task: task["priority"] - task["workers_num"] * 10, reverse=True)
|
||||
|
||||
for task in self.tasks: # Find a task
|
||||
if task["peers"] and peer not in task["peers"]:
|
||||
|
|
Loading…
Reference in a new issue