mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Clarify retried variable/comment
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
parent
2bef055247
commit
5cbb5101f7
@ -559,8 +559,8 @@ export class KubeApi<T extends KubeObject> {
|
|||||||
|
|
||||||
responsePromise
|
responsePromise
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// True if the watch was retried
|
// True if the current watch request was retried
|
||||||
let retried = false;
|
let requestRetried = false;
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
logger.warn(`[KUBE-API] watch (${watchId}) error response ${watchUrl}`, { status: response.status });
|
logger.warn(`[KUBE-API] watch (${watchId}) error response ${watchUrl}`, { status: response.status });
|
||||||
@ -573,7 +573,7 @@ export class KubeApi<T extends KubeObject> {
|
|||||||
if (timeout) {
|
if (timeout) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// We only retry if we haven't retried, haven't aborted and haven't received k8s error
|
// We only retry if we haven't retried, haven't aborted and haven't received k8s error
|
||||||
if (retried || abortController.signal.aborted || errorReceived) {
|
if (requestRetried || abortController.signal.aborted || errorReceived) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ export class KubeApi<T extends KubeObject> {
|
|||||||
|
|
||||||
logger.info(`[KUBE-API] Watch timeout set, but not retried, retrying now`);
|
logger.info(`[KUBE-API] Watch timeout set, but not retried, retrying now`);
|
||||||
|
|
||||||
retried = true;
|
requestRetried = true;
|
||||||
|
|
||||||
// Clearing out any possible timeout, although we don't expect this to be set
|
// Clearing out any possible timeout, although we don't expect this to be set
|
||||||
clearTimeout(timedRetry);
|
clearTimeout(timedRetry);
|
||||||
@ -595,13 +595,13 @@ export class KubeApi<T extends KubeObject> {
|
|||||||
response.body.on(eventName, () => {
|
response.body.on(eventName, () => {
|
||||||
// We only retry if we haven't retried, haven't aborted and haven't received k8s error
|
// We only retry if we haven't retried, haven't aborted and haven't received k8s error
|
||||||
// kubernetes errors (=errorReceived set) should be handled in a callback
|
// kubernetes errors (=errorReceived set) should be handled in a callback
|
||||||
if (retried || abortController.signal.aborted || errorReceived) {
|
if (requestRetried || abortController.signal.aborted || errorReceived) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info(`[KUBE-API] watch (${watchId}) ${eventName} ${watchUrl}`);
|
logger.info(`[KUBE-API] watch (${watchId}) ${eventName} ${watchUrl}`);
|
||||||
|
|
||||||
retried = true;
|
requestRetried = true;
|
||||||
|
|
||||||
clearTimeout(timedRetry);
|
clearTimeout(timedRetry);
|
||||||
timedRetry = setTimeout(() => { // we did not get any kubernetes errors so let's retry
|
timedRetry = setTimeout(() => { // we did not get any kubernetes errors so let's retry
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user