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 e24627cc3354b..a39781feb225d 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') @@ -983,7 +984,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