Skip to content

Commit fdca98d

Browse files
committed
add timeout to child process
1 parent 136e6e7 commit fdca98d

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

packages/core/src/awsService/ec2/sshKeyPair.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export class SshKeyPair {
8080
}
8181
return !(await tryRun('ssh-keygen', ['-t', keyType, '-N', '', '-q', '-f', keyPath], 'yes', 'unknown key type', {
8282
onStdout: overrideKeys,
83+
timeout: new Timeout(3000),
8384
}))
8485
}
8586

packages/core/src/shared/utilities/pathFind.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { GitExtension } from '../extensions/git'
1111
import { Settings } from '../settings'
1212
import { getLogger } from '../logger/logger'
1313
import { mergeResolvedShellPath } from '../env/resolveEnv'
14-
import { Timeout } from './timeoutUtils'
1514

1615
/** Full path to VSCode CLI. */
1716
let vscPath: string
@@ -33,13 +32,9 @@ export async function tryRun(
3332
p: string,
3433
args: string[],
3534
logging: 'yes' | 'no' | 'noresult' = 'yes',
36-
timeout?: Timeout,
3735
expected?: string,
3836
opt?: ChildProcessOptions
3937
): Promise<boolean> {
40-
timeout?.onCompletion(() => {
41-
throw new Error(`tryRun timed out: ${p} ${args.join(' ')}`)
42-
})
4338
const proc = new ChildProcess(p, args, { logging: 'no' })
4439
const r = await proc.run({
4540
...opt,

0 commit comments

Comments
 (0)