This commit is contained in:
Logan Ramos 2022-01-18 10:42:48 -05:00
parent 71a41ee8a5
commit d582efc551
No known key found for this signature in database
GPG key ID: D9CCFF14F0B18183

View file

@ -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 { }
});
});
}