skip updateBuildroots if we have just taken a task

This commit is contained in:
Mike McLean 2024-03-07 10:43:48 -05:00 committed by Tomas Kopecek
parent 1d0d4f2683
commit 9c8b9a1556

View file

@ -154,10 +154,11 @@ def main(options, session):
signal.signal(signal.SIGTERM, shutdown)
signal.signal(signal.SIGUSR1, restart)
exit_code = 0
taken = False
while True:
try:
taken = False
tm.updateBuildroots()
if not taken:
tm.updateBuildroots()
tm.updateTasks()
taken = tm.getNextTask()
except (SystemExit, ServerExit, KeyboardInterrupt):
@ -180,6 +181,7 @@ def main(options, session):
# XXX - this is a little extreme
# log the exception and continue
logger.error(''.join(traceback.format_exception(*sys.exc_info())))
taken = False
try:
if not taken:
# Only sleep if we didn't take a task, otherwise retry immediately.