瀏覽代碼

HUE-1847 [metastore] Dropping loads of dbs or tables makes the script to timeout

Optimized code
Enrico Berti 12 年之前
父節點
當前提交
6730c7f

+ 4 - 2
apps/metastore/src/metastore/templates/databases.mako

@@ -166,10 +166,12 @@ ${ components.menubar() }
       $.getJSON("${ url('metastore:drop_database') }", function (data) {
         $("#dropDatabaseMessage").text(data.title);
       });
-      viewModel.chosenDatabases.removeAll();
+      var _tempList = [];
       $(".hueCheckbox[checked='checked']").each(function (index) {
-        viewModel.chosenDatabases.push($(this).data("drop-name"));
+        _tempList.push($(this).data("drop-name"));
       });
+      viewModel.chosenDatabases.removeAll();
+      viewModel.chosenDatabases(_tempList);
       $("#dropDatabase").modal("show");
     });
   });

+ 4 - 2
apps/metastore/src/metastore/templates/tables.mako

@@ -201,10 +201,12 @@ ${ components.menubar() }
       $.getJSON("${ url('metastore:drop_table', database=database) }", function (data) {
         $("#dropTableMessage").text(data.title);
       });
-      viewModel.chosenTables.removeAll();
+      var _tempList = [];
       $(".hueCheckbox[checked='checked']").each(function (index) {
-        viewModel.chosenTables.push($(this).data("drop-name"));
+        _tempList.push($(this).data("drop-name"));
       });
+      viewModel.chosenTables.removeAll();
+      viewModel.chosenTables(_tempList);
       $("#dropTable").modal("show");
     });
   });