Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlie-777 committed Jun 25, 2024
1 parent 41a94c9 commit bcf4a15
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions AISKU/src/AISku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,23 +232,26 @@ export class AppInsightsSku implements IApplicationInsights {
});

});

let urlPromise = createAsyncPromise<string>((resolve, reject) => {
_parseCs().then((cs) => {
let url = _config.endpointUrl;
let ingest = cs && cs.ingestionendpoint;
url = ingest? ingest + DEFAULT_BREEZE_PATH : url;
resolve(url);
}).catch((e) => {
// parseCs will always resolve(unless timeout)
// return null in case any error happens
resolve(null);

let url: IPromise<string> | string = _config.userOverrideEndpointUrl;
if (isNullOrUndefined(url)) {
url = createAsyncPromise<string>((resolve, reject) => {
_parseCs().then((cs) => {
let url = _config.endpointUrl;
let ingest = cs && cs.ingestionendpoint;
url = ingest? ingest + DEFAULT_BREEZE_PATH : url;
resolve(url);
}).catch((e) => {
// parseCs will always resolve(unless timeout)
// return null in case any error happens
resolve(null);
});

});

});
}

_config.instrumentationKey = ikeyPromise;
_config.endpointUrl = _config.userOverrideEndpointUrl || urlPromise;
_config.endpointUrl = url;

}
if (isString(configCs)) {
Expand Down

0 comments on commit bcf4a15

Please sign in to comment.