File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { KubeConfig } from './config.js';
66export class Watch {
77 public static SERVER_SIDE_CLOSE : object = { error : 'Connection closed on server' } ;
88 public config : KubeConfig ;
9- private defaultRequestTimeoutMs : number = 30000 ;
9+ private requestTimeoutMs : number = 30000 ;
1010
1111 public constructor ( config : KubeConfig ) {
1212 this . config = config ;
@@ -40,7 +40,7 @@ export class Watch {
4040 const requestInit = await this . config . applyToFetchOptions ( { } ) ;
4141
4242 const controller = new AbortController ( ) ;
43- const timeoutSignal = AbortSignal . timeout ( this . defaultRequestTimeoutMs ) ;
43+ const timeoutSignal = AbortSignal . timeout ( this . requestTimeoutMs ) ;
4444 requestInit . signal = AbortSignal . any ( [ controller . signal , timeoutSignal ] ) ;
4545 requestInit . method = 'GET' ;
4646
Original file line number Diff line number Diff line change @@ -457,8 +457,9 @@ describe('Watch', () => {
457457 // Don't respond - simulate a hanging server
458458 } ) ;
459459 const watch = new Watch ( kc ) ;
460- // Hack around type system to make the default timeout shorter.
461- ( watch as any ) . timeoutMs = 100 ;
460+
461+ // NOTE: Hack around the type system to make the timeout shorter
462+ ( watch as any ) . requestTimeoutMs = 100 ;
462463
463464 let doneCalled = false ;
464465 let doneErr : any ;
You can’t perform that action at this time.
0 commit comments