Skip to content

Commit

Permalink
Remove duplicated setTimeout in error callback
Browse files Browse the repository at this point in the history
https://api.jquery.com/jQuery.ajax/
According to JQuery doc, `complete` will be called whether the ajax
request succeeds or fails. As a result, `_refreshClusterStatus` will
generates two new scheduled calls if the ajax request gets an error
response (one by `error` and one by `complete`).
If `_refreshClusterStatus` keeps getting error responses (e.g. token
has expired), it will generate a huge number of requests (doubles every
30s)
  • Loading branch information
upsilon2gamma committed Dec 13, 2023
1 parent 71440cc commit b0d7f7e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/ui/app/jsx/cluster-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ const Cluster = CreateReactClass({
},
error: function(data) {
console.error(this.component.props.name + " failed.");
this.component.setState({clusterStatuses: setTimeout(this.component._refreshClusterStatus, 30000)});

}
});
},
Expand Down

0 comments on commit b0d7f7e

Please sign in to comment.