mirror of
https://github.com/apache/superset.git
synced 2026-04-16 06:34:52 +00:00
Implement stop query functionality. (#2387)
* Implement stop query functionality. * Address comments
This commit is contained in:
@@ -142,6 +142,24 @@ export function runQuery(query) {
|
||||
};
|
||||
}
|
||||
|
||||
export function postStopQuery(query) {
|
||||
return function (dispatch) {
|
||||
const stopQueryUrl = '/superset/stop_query/';
|
||||
const stopQueryRequestData = { client_id: query.id };
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: stopQueryUrl,
|
||||
data: stopQueryRequestData,
|
||||
success() {
|
||||
if (!query.runAsync) {
|
||||
dispatch(stopQuery(query));
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function setDatabases(databases) {
|
||||
return { type: SET_DATABASES, databases };
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class SqlEditor extends React.PureComponent {
|
||||
this.props.actions.setActiveSouthPaneTab('Results');
|
||||
}
|
||||
stopQuery() {
|
||||
this.props.actions.stopQuery(this.props.latestQuery);
|
||||
this.props.actions.postStopQuery(this.props.latestQuery);
|
||||
}
|
||||
createTableAs() {
|
||||
this.startQuery(true, true);
|
||||
|
||||
Reference in New Issue
Block a user