Pārlūkot izejas kodu

[beeswax] Avoid Assist infinite loop on server timeout

Enrico Berti 10 gadi atpakaļ
vecāks
revīzija
977bd94
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      apps/beeswax/src/beeswax/templates/execute.mako

+ 4 - 1
apps/beeswax/src/beeswax/templates/execute.mako

@@ -1073,9 +1073,11 @@ var HIVE_AUTOCOMPLETE_APP = "${app_name}";
 
 var STATS_PROBLEMS = "${ _('There was a problem loading the stats.') }";
 
+var hasBeenResetAfterError = false;
 var HIVE_AUTOCOMPLETE_GLOBAL_CALLBACK = function (data) {
-  if (data != null && data.error && typeof resetNavigator != "undefined") {
+  if (data != null && data.error && typeof resetNavigator != "undefined" && !hasBeenResetAfterError) {
     resetNavigator();
+    hasBeenResetAfterError = true;
   }
 };
 
@@ -1630,6 +1632,7 @@ $(document).ready(function () {
 
   $(document).on("error.autocomplete", function(){
     $(".CodeMirror-spinner").remove();
+    $("#navigatorLoader").hide();
   });
 
   function splitStatements(hql) {