add telemetry for marketplace CDN fallback code

related to #10180
This commit is contained in:
Joao Moreno 2016-08-18 14:10:53 +02:00
parent 686646039b
commit 47876357ed

View file

@ -361,9 +361,14 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
parsedUrl.search = undefined;
parsedUrl.query['redirect'] = 'true';
return this.requestService.request(assign({}, options, { url: url.format(parsedUrl) }))
const cdnUrl = url.format(parsedUrl);
return this.requestService.request(assign({}, options, { url: cdnUrl }))
.then(context => context.res.statusCode === 200 ? context : TPromise.wrapError('expected 200'))
.then(null, () => this.requestService.request(options));
.then(null, () => {
this.telemetryService.publicLog('galleryService:cdnFallback', { url: cdnUrl });
return this.requestService.request(options);
});
}
private getLastValidExtensionVersion(extension: IRawGalleryExtension, versions: IRawGalleryExtensionVersion[]): TPromise<IRawGalleryExtensionVersion> {