浏览代码

[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 年之前
父节点
当前提交
d63b4ae4c8
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      desktop/core/src/desktop/js/apps/notebook2/execution/api.ts

+ 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({
   executable.addCancellable({
     cancel: async () => {
     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 {
       try {
         const response = await executePromise;
         const response = await executePromise;