Skip to content

Commit

Permalink
Fix type and improve name of ended variable
Browse files Browse the repository at this point in the history
`ended` is a boolean flag. Keeping final query info there is not
helpful.
  • Loading branch information
findepi committed Aug 29, 2019
1 parent e9c482e commit 31fa425
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion presto-main/src/main/resources/webapp/dist/query.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export class QueryDetail extends React.Component {
reservedMemory: [],

initialized: false,
ended: false,
queryEnded: false,

lastRefresh: null,
lastRender: null,
Expand Down Expand Up @@ -711,7 +711,7 @@ export class QueryDetail extends React.Component {
resetTimer() {
clearTimeout(this.timeoutId);
// stop refreshing when query finishes or fails
if (this.state.query === null || !this.state.ended) {
if (this.state.query === null || !this.state.queryEnded) {
// task.info-update-interval is set to 3 seconds by default
this.timeoutId = setTimeout(this.refreshLoop, 3000);
}
Expand All @@ -735,7 +735,7 @@ export class QueryDetail extends React.Component {
const lastCpuTime = this.state.lastCpuTime;
const lastRowInput = this.state.lastRowInput;
const lastByteInput = this.state.lastByteInput;
const alreadyEnded = this.state.ended;
const alreadyEnded = this.state.queryEnded;
const nowMillis = Date.now();

this.setState({
Expand All @@ -749,7 +749,7 @@ export class QueryDetail extends React.Component {
lastByteInput: parseDataSize(query.queryStats.processedInputDataSize),

initialized: true,
ended: query.finalQueryInfo,
queryEnded: !!query.finalQueryInfo,

lastRefresh: nowMillis,
});
Expand Down

0 comments on commit 31fa425

Please sign in to comment.