Skip to content

Commit

Permalink
add telemetry for marketplace CDN fallback code
Browse files Browse the repository at this point in the history
related to #10180
  • Loading branch information
joaomoreno committed Aug 18, 2016
1 parent 6866460 commit 4787635
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 4787635

Please sign in to comment.