From 65734a1e5a61fdd8fe99144dbbbc0917fe945f8f Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sun, 21 Jun 2020 17:39:57 -0700 Subject: [PATCH] make UI build timeout overridable --- hyperglass/util.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hyperglass/util.py b/hyperglass/util.py index 0719857..2d0d0cb 100644 --- a/hyperglass/util.py +++ b/hyperglass/util.py @@ -106,9 +106,15 @@ async def build_ui(app_path): RuntimeError: Raised if exit code is not 0. RuntimeError: Raised when any other error occurs. """ + import os import asyncio - timeout = 120 + try: + timeout = os.environ["HYPERGLASS_UI_BUILD_TIMEOUT"] + log.info("Found UI build timeout environment variable: {}", timeout) + timeout = int(timeout) + except KeyError: + timeout = 90 ui_dir = Path(__file__).parent / "ui" build_dir = app_path / "static" / "ui"