mirror of
git://git.yoctoproject.org/yocto-autobuilder2.git
synced 2025-07-19 12:49:03 +02:00
builders: Fix quarantine handling
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 <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
17c7b35155
commit
7353a843d5
15
builders.py
15
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
|
||||
|
||||
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:
|
||||
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()
|
||||
|
||||
wfb.worker.exitQuarantine()
|
||||
return True
|
||||
|
||||
def create_builder_factory():
|
||||
|
|
Loading…
Reference in New Issue
Block a user