Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superset Issue #4323 - Adding configurable poll interval for Hive Engine #4353

Merged
merged 1 commit into from Feb 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -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
Expand Down