superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #7446: feat: Scheduling queries from SQL Lab (#7416)
Date Thu, 16 May 2019 04:11:16 GMT
graceguo-supercat commented on a change in pull request #7446: feat: Scheduling queries from
SQL Lab (#7416)
URL: https://github.com/apache/incubator-superset/pull/7446#discussion_r284513097
 
 

 ##########
 File path: superset/assets/src/SqlLab/components/QueryAutoRefresh.jsx
 ##########
 @@ -41,10 +41,18 @@ class QueryAutoRefresh extends React.PureComponent {
     const { queries, queriesLastUpdate } = this.props;
     const now = new Date().getTime();
 
+    // due to a race condition, queries can be marked as successful before the
+    // results key is set; this is a workaround until we fix the underlying
+    // problem
+    const isQueryRunning = q => (
+      ['running', 'started', 'pending', 'fetching'].indexOf(q.state) >= 0 ||
+      (q.state === 'success' && q.resultsKey === null)
 
 Review comment:
   @DiggidyDave this logic is problematic. Sql Lab can run async and synchronous queries.
For synchronous queries, it will not have a resultsKey.
   
   the new logic will make extra polling happen when user has at least 1 synchronous query
(and < 6 hours old). For synchronous queries, results are returned from sql_json request,
polling should not happen.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Mime
View raw message