mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Fix #140624
This commit is contained in:
parent
71a41ee8a5
commit
d582efc551
|
@ -95,24 +95,30 @@ export class AppInsightsAppender implements ITelemetryAppender {
|
|||
data.properties['common.useragent'] = this.mirrored ? 'mirror-collector++' : 'collector++';
|
||||
}
|
||||
|
||||
this._withAIClient((aiClient) => aiClient.trackEvent({
|
||||
name: this._eventPrefix + '/' + eventName,
|
||||
properties: data.properties,
|
||||
measurements: data.measurements
|
||||
}));
|
||||
// Attemps to suppress https://github.com/microsoft/vscode/issues/140624
|
||||
try {
|
||||
this._withAIClient((aiClient) => aiClient.trackEvent({
|
||||
name: this._eventPrefix + '/' + eventName,
|
||||
properties: data.properties,
|
||||
measurements: data.measurements
|
||||
}));
|
||||
} catch { }
|
||||
}
|
||||
|
||||
flush(): Promise<any> {
|
||||
if (this._aiClient) {
|
||||
return new Promise(resolve => {
|
||||
this._withAIClient((aiClient) => {
|
||||
aiClient.flush({
|
||||
callback: () => {
|
||||
// all data flushed
|
||||
this._aiClient = undefined;
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
// Attempts to suppress https://github.com/microsoft/vscode/issues/140624
|
||||
try {
|
||||
aiClient.flush({
|
||||
callback: () => {
|
||||
// all data flushed
|
||||
this._aiClient = undefined;
|
||||
resolve(undefined);
|
||||
}
|
||||
});
|
||||
} catch { }
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue