File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ export enum ConnectivityState {
48
48
SHUTDOWN ,
49
49
}
50
50
51
+ /**
52
+ * See https://nodejs.org/api/timers.html#timers_setinterval_callback_delay_args
53
+ */
54
+ const MAX_TIMEOUT_TIME = 2147483647 ;
55
+
51
56
let nextCallNumber = 0 ;
52
57
53
58
function getNewCallNumber ( ) : number {
@@ -185,6 +190,10 @@ export class ChannelImplementation implements Channel {
185
190
`Could not find a default scheme for target name "${ target } "`
186
191
) ;
187
192
}
193
+
194
+ this . callRefTimer = setInterval ( ( ) => { } , MAX_TIMEOUT_TIME ) ;
195
+ this . callRefTimer . unref ?.( ) ;
196
+
188
197
if ( this . options [ 'grpc.default_authority' ] ) {
189
198
this . defaultAuthority = this . options [ 'grpc.default_authority' ] as string ;
190
199
} else {
@@ -239,9 +248,6 @@ export class ChannelImplementation implements Channel {
239
248
new MaxMessageSizeFilterFactory ( this . options ) ,
240
249
new CompressionFilterFactory ( this ) ,
241
250
] ) ;
242
-
243
- this . callRefTimer = setInterval ( ( ) => { } , 1 << 31 - 1 ) ;
244
- this . callRefTimer . unref ?.( ) ;
245
251
}
246
252
247
253
private pushPick ( callStream : Http2CallStream , callMetadata : Metadata ) {
You can’t perform that action at this time.
0 commit comments