Skip to contentSkip to conversation

builders.py: fix bonus time calculation

PATCH New Trevor Gamblin 1 participant 1 message Oct 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 builders.py: fix bonus time calculation

Modify the builder_bonuses calculation so that it provides variable bonus time based on the builder, rather than a constant value.

---
 builders.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builders.py +1 -1
index 5773950..f94d1dd 100644
@@ -145,7 +145,7 @@ for builder in config.subbuilders:
 # Add 2 seconds * length as the weight so tightly constrained builders go first
 builder_bonuses = {}
 for builder in config.builder_to_workers:
-    bonus = (len(config.workers) - len(config.builder_to_workers)) * 2
+    bonus = (len(config.workers) - len(config.builder_to_workers[builder])) * 2
     builder_bonuses[builder] = timedelta(seconds=bonus)
 
 # Modified default algothirm from buildbot with a bonus mechanism (thanks tardyp!)
Signature · 1 line
2.31.1