mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
make linter happy
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
bc09a632ff
commit
3d579f7002
@ -425,7 +425,7 @@ export class KubeApi<T extends KubeObject> {
|
|||||||
let errorReceived = false;
|
let errorReceived = false;
|
||||||
let timedRetry: NodeJS.Timeout;
|
let timedRetry: NodeJS.Timeout;
|
||||||
const { abortController: { abort, signal } = new AbortController(), namespace, callback = noop, retry } = opts;
|
const { abortController: { abort, signal } = new AbortController(), namespace, callback = noop, retry } = opts;
|
||||||
let { watchId = `${this.kind.toLowerCase()}-${this.watchId++}` } = opts;
|
const { watchId = `${this.kind.toLowerCase()}-${this.watchId++}` } = opts;
|
||||||
|
|
||||||
signal.addEventListener("abort", () => {
|
signal.addEventListener("abort", () => {
|
||||||
logger.info(`[KUBE-API] watch (${watchId}) aborted ${watchUrl}`);
|
logger.info(`[KUBE-API] watch (${watchId}) aborted ${watchUrl}`);
|
||||||
@ -434,12 +434,14 @@ export class KubeApi<T extends KubeObject> {
|
|||||||
|
|
||||||
const watchUrl = this.getWatchUrl(namespace);
|
const watchUrl = this.getWatchUrl(namespace);
|
||||||
const responsePromise = this.request.getResponse(watchUrl, null, { signal, timeout: 600_000 });
|
const responsePromise = this.request.getResponse(watchUrl, null, { signal, timeout: 600_000 });
|
||||||
logger.info(`[KUBE-API] watch (${watchId}) ${ retry === true ? "retried" : "started" } ${watchUrl}`);
|
|
||||||
|
logger.info(`[KUBE-API] watch (${watchId}) ${retry === true ? "retried" : "started"} ${watchUrl}`);
|
||||||
|
|
||||||
responsePromise
|
responsePromise
|
||||||
.then(response => {
|
.then(response => {
|
||||||
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 });
|
||||||
|
|
||||||
return callback(null, response);
|
return callback(null, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user