Răsfoiți Sursa

HUE-7439 [editor] Move optimizer call to after check status

Snappier fetch results this way.
Romain Rigaux 8 ani în urmă
părinte
comite
e2a97d6

+ 3 - 3
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1306,9 +1306,6 @@ var EditorViewModel = (function() {
         if (data.status == 0) {
           self.result.handle(data.handle);
           self.result.hasResultset(data.handle.has_result_set);
-          if (vm.isOptimizerEnabled()) {
-            huePubSub.publish('editor.upload.query', data.history_id);
-          }
           if (data.handle.sync) {
             self.loadData(data.result, 100);
             self.status('available');
@@ -1318,6 +1315,9 @@ var EditorViewModel = (function() {
               self.checkStatus();
             }
           }
+          if (vm.isOptimizerEnabled()) {
+            huePubSub.publish('editor.upload.query', data.history_id);
+          }
         } else {
           self._ajaxError(data, self.execute);
         }