1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-18 20:50:10 +01:00

build: add global soft timeout of 12 hours

Only start new builds for 12 hours. This ensures we publish new builds
often enough even on long backlogs.

This could be made configurable at a later point.
This commit is contained in:
Marcus Hoffmann 2018-01-19 22:35:06 +01:00
parent 80e121d182
commit fa43066f8d
No known key found for this signature in database
GPG Key ID: ACDF63BC43D5E530

View File

@ -1151,11 +1151,17 @@ def main():
# Build applications...
failed_apps = {}
build_succeeded = []
# Only build for 12 hours, then stop gracefully
endtime = time.time() + 12 * 60 * 60
max_build_time_reached = False
for appid, app in apps.items():
first = True
for build in app.builds:
if time.time() > endtime:
max_build_time_reached = True
break
if options.server: # enable watchdog timer
timer = threading.Timer(7200, force_halt_build)
timer.start()
@ -1305,6 +1311,10 @@ def main():
if timer:
timer.cancel() # kill the watchdog timer
if max_build_time_reached:
logging.info("Stopping after global build timeout...")
break
for app in build_succeeded:
logging.info("success: %s" % (app.id))