From fbbd8cadcf3a55e3fdb3787271ccda5493be1a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bry=C5=84ski?= Date: Thu, 8 Feb 2018 06:29:31 +0100 Subject: [PATCH] Superset issue #4323 (#4353) Adding configurable poll interval for Hive Engine --- superset/config.py | 3 +++ superset/db_engine_specs.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/superset/config.py b/superset/config.py index c2da1db8b55c7..48c893abb2550 100644 --- a/superset/config.py +++ b/superset/config.py @@ -359,6 +359,9 @@ class CeleryConfig(object): # into a proxied one TRACKING_URL_TRANSFORMER = lambda x: x # noqa: E731 +# Interval between consecutive polls when using Hive Engine +HIVE_POLL_INTERVAL = 5 + try: if CONFIG_PATH_ENV_VAR in os.environ: # Explicitly import config module that is not in pythonpath; useful diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 112b3ba8cf01e..b961c03152a6c 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -42,6 +42,7 @@ config = app.config tracking_url_trans = conf.get('TRACKING_URL_TRANSFORMER') +hive_poll_interval = conf.get('HIVE_POLL_INTERVAL') Grain = namedtuple('Grain', 'name label function') @@ -993,7 +994,7 @@ def handle_cursor(cls, cursor, query, session): last_log_line = len(log_lines) if needs_commit: session.commit() - time.sleep(5) + time.sleep(hive_poll_interval) polled = cursor.poll() @classmethod