The way the canStartBuild code was written, it inserted a delay between
each build starting of 2 minutes unconditionally. We only want to do this
if the worker had run out of space so tweak the code accordingly.

Signed-off-by: Richard Purdie <[email protected]>
---
 builders.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/builders.py b/builders.py
index 20ad0bb2..e575a1a6 100644
--- a/builders.py
+++ b/builders.py
@@ -69,16 +69,17 @@ def canStartBuild(builder, wfb, request):
     threshold = 60 # GB of space
     if int(cmd.stdout) < threshold:
         log.msg("Detected {0} GB of space available, less than threshold of 
{1} GB. Can't start build".format(cmd.stdout, threshold))
+        wfb.worker.quarantine_timeout = 2 * 60
         wfb.worker.putInQuarantine()
         return False
-    else:
-        log.msg("Detected {0} GB of space available, more than threshold of 
{1} GB. OK to build".format(cmd.stdout, threshold))
-
-    wfb.worker.quarantine_timeout = 120
-    wfb.worker.putInQuarantine()
-
-    wfb.worker.resetQuarantine()
 
+    log.msg("Detected {0} GB of space available, more than threshold of {1} 
GB. OK to build".format(cmd.stdout, threshold))
+    if wfb.worker.isPaused:
+        # It was low on space so delay the builds starting a bit
+        wfb.worker.quarantine_timeout = 2 * 60
+        wfb.worker.putInQuarantine()
+    else:
+        wfb.worker.exitQuarantine()
     return True
 
 def create_builder_factory():
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#55194): https://lists.yoctoproject.org/g/yocto/message/55194
Mute This Topic: https://lists.yoctoproject.org/mt/86703030/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to