Skip to content

Commit 15d6e52

Browse files
committed
fix: get signal from options
1 parent 7a9c338 commit 15d6e52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/health.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import fetch from 'node-fetch';
2-
import { AbortSignal } from 'node-fetch/externals';
32
import { KubeConfig } from './config';
43
import { RequestOptions } from 'node:https';
54

@@ -30,8 +29,9 @@ export class Health {
3029

3130
const requestURL = new URL(cluster.server + path);
3231
const requestInit = await this.config.applyToFetchOptions(opts);
33-
const controller = new AbortController();
34-
requestInit.signal = controller.signal as AbortSignal;
32+
if (opts.signal) {
33+
requestInit.signal = opts.signal;
34+
}
3535
requestInit.method = 'GET';
3636

3737
try {

0 commit comments

Comments
 (0)