From fa43066f8df414f715f9f88858d638d9d39cb2e1 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Fri, 19 Jan 2018 22:35:06 +0100 Subject: [PATCH] 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. --- fdroidserver/build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 9e2a7a3f..05700cf7 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -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))