mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-01 05:04:59 +01:00
Add a delay, mitigates #141053
This commit is contained in:
@@ -401,7 +401,11 @@ export async function main(argv: string[]): Promise<any> {
|
||||
const stream = outputType === 'stdout' ? process.stdout : process.stderr;
|
||||
|
||||
const cts = new CancellationTokenSource();
|
||||
child.on('close', () => cts.dispose(true));
|
||||
child.on('close', () => {
|
||||
// We must dispose the token to stop watching,
|
||||
// but the watcher might still be reading data.
|
||||
setTimeout(() => cts.dispose(true), 200);
|
||||
});
|
||||
await watchFileContents(tmpName, chunk => stream.write(chunk), () => { /* ignore */ }, cts.token);
|
||||
} finally {
|
||||
unlinkSync(tmpName);
|
||||
|
||||
Reference in New Issue
Block a user