betodealmeida commented on a change in pull request #15403:
URL: https://github.com/apache/superset/pull/15403#discussion_r667068723



##########
File path: superset-frontend/src/SqlLab/components/SqlEditor.jsx
##########
@@ -242,6 +245,13 @@ class SqlEditor extends React.PureComponent {
     }
   }
 
+  onBeforeUnload(event) {
+    if (this.props.latestQuery?.state === 'running') {
+      event.preventDefault();
+      this.stopQuery();

Review comment:
       Sure, if there's a legit use case let's make it configurable. I like the 
idea of having a per-DB option, this way for Hive we could have it off (since 
queries can take hours), and for Postgres (say) we could have it on.
   
   @yousoph, any thoughts here?
   
   > Furthermore if it works only in sync mode then the stop button is 
basically doing nothing in async mode with non hive/presto databases.
   
   Oh, sorry if I wasn't clear, I meant stopping a query by **navigating 
away**. If we press the stop button we should still cancel async queries, 
regardless of the configuration flag.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to