1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Use opts.abortController.abort?.() if present

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen 2021-11-22 14:53:13 +02:00
parent e6e0ce05d2
commit 2f478f1b9d
No known key found for this signature in database
GPG Key ID: 54B44603D251B788

View File

@ -584,7 +584,11 @@ export class KubeApi<T extends KubeObject> {
logger.info(`[KUBE-API] system suspended, abort watching of ${watchUrl}...`); logger.info(`[KUBE-API] system suspended, abort watching of ${watchUrl}...`);
try { try {
abort(); if (opts.abortController) {
opts.abortController.abort?.();
} else {
abort?.();
}
} catch (error) { } catch (error) {
logger.error(`[KUBE-API] error aborting watch (${watchId})`, error); logger.error(`[KUBE-API] error aborting watch (${watchId})`, error);
} }