Prevent a query being executed whilst one is already in progress. Fixes #1532

This commit is contained in:
Surinder Kumar 2016-08-16 12:10:16 +01:00 committed by Dave Page
parent a3e8ba93ae
commit 6d839a2924

View File

@ -32,6 +32,8 @@ define(
F7_KEY = 118,
F8_KEY = 119;
var is_query_running = false;
// Defining the backbone model for the sql grid
var sqlEditorViewModel = Backbone.Model.extend({
@ -1049,6 +1051,9 @@ define(
* Shift+F7 - Explain analyze query
*/
keyAction: function(ev) {
// return if query is running
if (is_query_running) return;
var keyCode = ev.which || ev.keyCode;
if (ev.shiftKey && keyCode == F7_KEY) {
// Explain analyze query.
@ -1294,10 +1299,12 @@ define(
self.disable_tool_buttons(false);
$("#btn-cancel-query").prop('disabled', true);
}
is_query_running = false;
}
else if (res.data.status === 'Busy') {
// If status is Busy then poll the result by recursive call to the poll function
self._poll();
is_query_running = true;
}
else if (res.data.status === 'NotConnected') {