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:
parent
e6e0ce05d2
commit
2f478f1b9d
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user