From 3958b87699b89b6ad178c4ad54b498a33e93e1e4 Mon Sep 17 00:00:00 2001 From: lukasmartinelli Date: Wed, 22 Jun 2016 21:45:38 +0200 Subject: [PATCH] Support configurable render timeout --- docker-compose.yml | 1 + src/export/export_remote.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4c920d3..e01e165 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -106,6 +106,7 @@ export-worker: AWS_SECRET_ACCESS_KEY: "${AWS_SECRET_ACCESS_KEY}" AWS_S3_HOST: "${AWS_S3_HOST}" BUCKET_NAME: "osm2vectortiles-testing" + RENDER_TIMEOUT: "1200" export: image: "osm2vectortiles/export" command: ./export-local.sh diff --git a/src/export/export_remote.py b/src/export/export_remote.py index 6175850..6ed2d32 100644 --- a/src/export/export_remote.py +++ b/src/export/export_remote.py @@ -165,7 +165,9 @@ def handle_message(tm2source, bucket, s3_url, body): else: raise ValueError("Message must be either of type pyramid or list") - _, render_time = timing(subprocess.check_call, tilelive_cmd, timeout=5*60) + render_timeout = int(os.getenv('RENDER_TIMEOUT', 5 * 60)) + _, render_time = timing(subprocess.check_call, tilelive_cmd, + timeout=render_timeout) print('Render MBTiles: {}'.format(naturaltime(render_time))) _, optimize_time = timing(optimize_mbtiles, mbtiles_file)