Making the stop button instantaneous (#2738)

This commit is contained in:
Maxime Beauchemin 2017-05-09 16:10:08 -07:00 committed by GitHub
parent baebba1159
commit 22d8075c53

View File

@ -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.');
},
});
};