File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -219,22 +219,21 @@ export class StdioClientTransport implements Transport {
219219 } ) ;
220220 } ) ;
221221
222+ try {
223+ processToClose . stdin ?. end ( ) ;
224+ } catch {
225+ // ignore
226+ }
227+
222228 this . _abortController . abort ( ) ;
223229
224- // waits the underlying process to exit cleanly otherwise after 1s kills it
225- await Promise . race ( [ closePromise , new Promise ( resolve => setTimeout ( resolve , 1_000 ) . unref ( ) ) ] ) ;
230+ await Promise . race ( [ closePromise , new Promise ( resolve => setTimeout ( resolve , 2_000 ) . unref ( ) ) ] ) ;
226231
227232 if ( processToClose . exitCode === null ) {
228- try {
229- processToClose . stdin ?. end ( ) ;
230- } catch {
231- // ignore errors in trying to close stdin
232- }
233-
234233 try {
235234 processToClose . kill ( 'SIGKILL' ) ;
236235 } catch {
237- // we did our best
236+ // ignore
238237 }
239238 }
240239 }
You can’t perform that action at this time.
0 commit comments