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

Add command to refresh datasources #2180

Merged
merged 1 commit into from
Feb 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions superset/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,19 @@ def refresh_druid(datasource, merge):
session.commit()


@manager.command
def update_datasources_cache():
"""Refresh sqllab datasources cache"""
from superset import models
for database in db.session.query(models.Database).all():
print('Fetching {} datasources ...'.format(database.name))
try:
database.all_table_names()
database.all_view_names()
except Exception as e:
print('{}'.format(e.message))


@manager.option(
'-w', '--workers', default=config.get("SUPERSET_CELERY_WORKERS", 32),
help="Number of celery server workers to fire up")
Expand Down