Jelajahi Sumber

[editor2] Avoid disabling cancel button in stream queries

Will need to double check the logic of running vs streaming as
currently does not work with streaming.
Romain Rigaux 4 tahun lalu
induk
melakukan
d63b4ae4c8

+ 6 - 2
desktop/core/src/desktop/js/apps/notebook2/execution/api.ts

@@ -216,8 +216,12 @@ export const executeStatement = async (options: ExecuteApiOptions): Promise<Exec
 
   executable.addCancellable({
     cancel: async () => {
-      if (executable.status !== EXECUTION_STATUS.running) {
-        return;
+      if (
+        executable.status !== EXECUTION_STATUS.running &&
+        executable.status !== EXECUTION_STATUS.streaming
+      ) {
+        // executable.status seems to have been set to 'canceling' so ignoring for now
+        // return;
       }
       try {
         const response = await executePromise;