Skip to content

Commit

Permalink
Superset issue #4323 (#4353)
Browse files Browse the repository at this point in the history
Adding configurable poll interval for Hive Engine
  • Loading branch information
maver1ck authored and mistercrunch committed Feb 8, 2018
1 parent 0480fa0 commit 387bf76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions superset/config.py
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion superset/db_engine_specs.py
Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 387bf76

Please sign in to comment.