diff --git a/web/pgadmin/tools/debugger/templates/debugger/js/direct.js b/web/pgadmin/tools/debugger/templates/debugger/js/direct.js index 4574716..502da93 100644 --- a/web/pgadmin/tools/debugger/templates/debugger/js/direct.js +++ b/web/pgadmin/tools/debugger/templates/debugger/js/direct.js @@ -92,26 +92,30 @@ define( // Make ajax call to listen the database message var baseUrl = "{{ url_for('debugger.index') }}" + "execute_query/" + trans_id + "/" + "get_breakpoints"; - $.ajax({ - url: baseUrl, - method: 'GET', - async: false, - success: function(res) { - if (res.data.status === 'Success') { - result = res.data.result; - } - else if (res.data.status === 'NotConnected') { - Alertify.alert( - 'Debugger: Error fetching breakpoint information' - ); - } - }, - error: function(e) { - Alertify.alert( - 'Debugger: Error fetching breakpoint information' - ); - } - }); + setTimeout( + function() { + $.ajax({ + url: baseUrl, + method: 'GET', + async: false, + success: function(res) { + if (res.data.status === 'Success') { + result = res.data.result; + } + else if (res.data.status === 'NotConnected') { + Alertify.alert( + 'Debugger: Error fetching breakpoint information' + ); + } + }, + error: function(e) { + Alertify.alert( + 'Debugger: Error fetching breakpoint information' + ); + } + }); + }, 350); + return result; }, @@ -187,27 +191,30 @@ define( // Make ajax call to listen the database message var baseUrl = "{{ url_for('debugger.index') }}" + "execute_query/" + trans_id + "/" + "get_variables"; - $.ajax({ - url: baseUrl, - method: 'GET', - success: function(res) { - if (res.data.status === 'Success') { - // Call function to create and update local variables - self.AddLocalVariables(res.data.result); - self.AddParameters(res.data.result); - } - else if (res.data.status === 'NotConnected') { + setTimeout( + function() { + $.ajax({ + url: baseUrl, + method: 'GET', + success: function(res) { + if (res.data.status === 'Success') { + // Call function to create and update local variables + self.AddLocalVariables(res.data.result); + self.AddParameters(res.data.result); + } + else if (res.data.status === 'NotConnected') { + Alertify.alert( + 'Debugger: Error fetching variable information' + ); + } + }, + error: function(e) { Alertify.alert( 'Debugger: Error fetching variable information' ); } - }, - error: function(e) { - Alertify.alert( - 'Debugger: Error fetching variable information' - ); - } - }); + }); + }, 400); }, // Get the stack information of the functions and update the grid @@ -217,26 +224,29 @@ define( // Make ajax call to listen the database message var baseUrl = "{{ url_for('debugger.index') }}" + "execute_query/" + trans_id + "/" + "get_stack_info"; - $.ajax({ - url: baseUrl, - method: 'GET', - success: function(res) { - if (res.data.status === 'Success') { - // Call function to create and update stack information - self.AddStackInformation(res.data.result); - } - else if (res.data.status === 'NotConnected') { + setTimeout( + function() { + $.ajax({ + url: baseUrl, + method: 'GET', + success: function(res) { + if (res.data.status === 'Success') { + // Call function to create and update stack information + self.AddStackInformation(res.data.result); + } + else if (res.data.status === 'NotConnected') { + Alertify.alert( + 'Debugger: Error fetching stack information' + ); + } + }, + error: function(e) { Alertify.alert( 'Debugger: Error fetching stack information' ); } - }, - error: function(e) { - Alertify.alert( - 'Debugger: Error fetching stack information' - ); - } - }); + }); + }, 600); }, /* @@ -845,7 +855,6 @@ define( // Render the stack grid into stack panel pgTools.DirectDebug.stack_pane_panel.$container.find('.stack_pane').append(stack_grid.el); - }, AddResults: function(result) {