mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Check if abort is a function
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
parent
068a92365e
commit
37eef77d4b
@ -549,10 +549,10 @@ export class KubeApi<T extends KubeObject> {
|
||||
logger.info(`[KUBE-API] system suspended, abort watching of ${watchUrl}...`);
|
||||
|
||||
try {
|
||||
if (opts.abortController) {
|
||||
opts.abortController.abort?.();
|
||||
} else {
|
||||
abort?.();
|
||||
if (typeof opts.abortController?.abort === "function") {
|
||||
opts.abortController.abort();
|
||||
} else if (typeof abort === "function") {
|
||||
abort();
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`[KUBE-API] error aborting watch (${watchId})`, error);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user