According to JQuery doc (https://api.jquery.com/jQuery.ajax/), complete function will be called whether the ajax request succeeds or fails. As a result, _refreshClusterStatus will set two new scheduled calls if the ajax request gets an error response (the first one by error and the second one by complete).
If _refreshClusterStatus keeps getting error responses (e.g. token has expired, the ajax request always gets 304 response), it will generate a huge number of requests in 10min (doubles every 30s)
Project board link
https://github.com/thelastpickle/cassandra-reaper/blob/master/src/ui/app/jsx/cluster-list.jsx#L52-L71
According to JQuery doc (https://api.jquery.com/jQuery.ajax/),
complete
function will be called whether the ajax request succeeds or fails. As a result,_refreshClusterStatus
will set two new scheduled calls if the ajax request gets an error response (the first one byerror
and the second one bycomplete
).If
_refreshClusterStatus
keeps getting error responses (e.g. token has expired, the ajax request always gets 304 response), it will generate a huge number of requests in 10min (doubles every 30s)