buildbot: improve error handling

This commit is contained in:
JerryXiao 2019-09-05 22:59:11 +08:00
parent 2e8ac27830
commit 91a8e844f5
Signed by: Jerry
GPG key ID: 9D9CE43650FF2BAA

View file

@ -482,19 +482,13 @@ if __name__ == '__main__':
__main() # start the Listener thread
logger.info('Listener started.')
while True:
try:
try:
ret = 1
ret = jobsmgr.tick()
except Exception:
try:
jobsmgr.clean_failed_job()
except Exception:
print_exc_plus()
print_exc_plus()
except KeyboardInterrupt:
logger.info('KeyboardInterrupt')
print_exc_plus()
break
if ret is None:
sleep(1)
elif ret == 0:
@ -503,3 +497,9 @@ if __name__ == '__main__':
sleep(ret)
else:
sleep(1)
except Exception:
print_exc_plus()
except KeyboardInterrupt:
logger.info('KeyboardInterrupt')
print_exc_plus()
break