Explorar o código

HUE-8973 [tb] Fix reload button for the table listing

Johan Ahlen %!s(int64=6) %!d(string=hai) anos
pai
achega
f56a58129e

+ 14 - 3
desktop/core/src/desktop/js/apps/table_browser/metastoreDatabase.js

@@ -92,10 +92,21 @@ class MetastoreDatabase {
   }
 
   reload() {
+    if (this.loading()) {
+      return;
+    }
     // Clear will publish when done
-    this.catalogEntry.clearCache({
-      invalidate: this.catalogEntry.getSourceType() === 'impala' ? 'invalidate' : 'cache'
-    });
+    this.catalogEntry
+      .clearCache({
+        invalidate: this.catalogEntry.getSourceType() === 'impala' ? 'invalidate' : 'cache'
+      })
+      .then(() => {
+        this.load(
+          () => {},
+          this.metastoreViewModel.optimizerEnabled,
+          this.metastoreViewModel.navigatorEnabled
+        );
+      });
   }
 
   load(callback, optimizerEnabled, navigatorEnabled) {