mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-19 06:39:55 +01:00
CLI - Add a 1 second timeout for flushing the telemetry (#97622)
* Add a 1 second timeout for flushing the telemetry
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { raceTimeout } from 'vs/base/common/async';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as semver from 'semver-umd';
|
||||
@@ -361,8 +362,10 @@ export async function main(argv: ParsedArgs): Promise<void> {
|
||||
|
||||
try {
|
||||
await main.run(argv);
|
||||
|
||||
// Flush the remaining data in AI adapter.
|
||||
await combinedAppender(...appenders).flush();
|
||||
// If it does not complete in 1 second, exit the process.
|
||||
await raceTimeout(combinedAppender(...appenders).flush(), 1000);
|
||||
} finally {
|
||||
disposables.dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user