Skip to content

Commit

Permalink
Superset issue apache#4323 (apache#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 michellethomas committed May 23, 2018
1 parent 55d841f commit fbbd8ca
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 fbbd8ca

Please sign in to comment.