This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 3c2e3d7 Fixes #6842: Refreshes all metadata and datasource (#6944)
3c2e3d7 is described below
commit 3c2e3d7f971b2af7187ca9b8f6a1b90f1acfe3bb
Author: Prashant Shahi <[email protected]>
AuthorDate: Tue Feb 26 07:14:47 2019 +0530
Fixes #6842: Refreshes all metadata and datasource (#6944)
---
superset/connectors/druid/views.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/superset/connectors/druid/views.py
b/superset/connectors/druid/views.py
index 1c13b77..0981dc3 100644
--- a/superset/connectors/druid/views.py
+++ b/superset/connectors/druid/views.py
@@ -329,20 +329,23 @@ class Druid(BaseSupersetView):
DruidCluster = ConnectorRegistry.sources['druid'].cluster_class
for cluster in session.query(DruidCluster).all():
cluster_name = cluster.cluster_name
+ valid_cluster = True
try:
cluster.refresh_datasources(refreshAll=refreshAll)
except Exception as e:
+ valid_cluster = False
flash(
"Error while processing cluster '{}'\n{}".format(
cluster_name, utils.error_msg_from_exception(e)),
'danger')
logging.exception(e)
- return redirect('/druidclustermodelview/list/')
- cluster.metadata_last_refreshed = datetime.now()
- flash(
- _('Refreshed metadata from cluster [{}]').format(
- cluster.cluster_name),
- 'info')
+ pass
+ if valid_cluster:
+ cluster.metadata_last_refreshed = datetime.now()
+ flash(
+ _('Refreshed metadata from cluster [{}]').format(
+ cluster.cluster_name),
+ 'info')
session.commit()
return redirect('/druiddatasourcemodelview/list/')