tweak rank calculation
This commit is contained in:
parent
c4f7724647
commit
7c416d68d1
1 changed files with 4 additions and 1 deletions
|
|
@ -926,7 +926,10 @@ class TaskManager(object):
|
|||
for pos, cap in enumerate(bin_avail):
|
||||
if our_avail >= cap:
|
||||
break
|
||||
rank = float(pos) / len(bin_avail)
|
||||
if len(bin_avail) > 1:
|
||||
rank = float(pos) / (len(bin_avail) - 1)
|
||||
else:
|
||||
rank = 0.0
|
||||
# so, 0.0 for highest available capacity, 1.0 for lowest
|
||||
|
||||
delay = getattr(self.options, 'task_avail_delay', 180)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue