From 9252a25171b5b1a1326c11748cfef9e5db8314d7 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 9 May 2017 15:24:27 -0700 Subject: [PATCH] Making the stop button instantaneous --- superset/assets/javascripts/SqlLab/actions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/superset/assets/javascripts/SqlLab/actions.js b/superset/assets/javascripts/SqlLab/actions.js index 6d62436fcbe9..a5c9d8a67416 100644 --- a/superset/assets/javascripts/SqlLab/actions.js +++ b/superset/assets/javascripts/SqlLab/actions.js @@ -164,15 +164,17 @@ export function postStopQuery(query) { return function (dispatch) { const stopQueryUrl = '/superset/stop_query/'; const stopQueryRequestData = { client_id: query.id }; + dispatch(stopQuery(query)); $.ajax({ type: 'POST', dataType: 'json', url: stopQueryUrl, data: stopQueryRequestData, success() { - if (!query.runAsync) { - dispatch(stopQuery(query)); - } + notify.success('Query was stopped.'); + }, + error() { + notify.error('Failed at stopping query.'); }, }); };