Skip to content

Commit

Permalink
[sql lab] Fix new query stuck at pending state (#7523)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7f858e4)
  • Loading branch information
Grace Guo authored and michellethomas committed Jun 1, 2019
1 parent dbaa37f commit e4bed9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions superset/assets/src/SqlLab/components/QueryAutoRefresh.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ class QueryAutoRefresh extends React.PureComponent {
}
shouldCheckForQueries() {
// if there are started or running queries, this method should return true
const { queries, queriesLastUpdate } = this.props;
const { queries } = this.props;
const now = new Date().getTime();

return (
queriesLastUpdate > 0 &&
Object.values(queries).some(
q => ['running', 'started', 'pending', 'fetching'].indexOf(q.state) >= 0 &&
now - q.startDttm < MAX_QUERY_AGE_TO_POLL,
Expand Down

0 comments on commit e4bed9d

Please sign in to comment.