소스 검색

[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({
     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;