timifasubaa commented on a change in pull request #4833: [sqllab] Help sqllab
forget query history
URL:
https://github.com/apache/incubator-superset/pull/4833#discussion_r186486683
##########
File path: superset/assets/src/SqlLab/components/QueryAutoRefresh.jsx
##########
@@ -19,10 +19,12 @@ class QueryAutoRefresh extends React.PureComponent {
shouldCheckForQueries() {
// if there are started or running queries, this method should return true
const { queries } = this.props;
- const queryKeys = Object.keys(queries);
- const queriesAsArray = queryKeys.map(key => queries[key]);
- return queriesAsArray.some(q =>
- ['running', 'started', 'pending', 'fetching'].indexOf(q.state) >= 0);
+ const now = new Date().getTime();
+ return Object.values(queries)
+ .some(
+ q => ['running', 'started', 'pending', 'fetching'].indexOf(q.state) >=
0 &&
+ now - q.startDttm < 21600000,
Review comment:
Done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]