From a80f321353a5590d337a84d2f038ad76aaeb7dda Mon Sep 17 00:00:00 2001 From: Anton Ganhammar Date: Fri, 18 Aug 2023 15:07:14 +0200 Subject: [PATCH] chore: re-ask for the code-coverage url before fetching Signed-off-by: Anton Ganhammar --- plugins/code-coverage/src/api.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/code-coverage/src/api.ts b/plugins/code-coverage/src/api.ts index 9947891006..942e5a8a47 100644 --- a/plugins/code-coverage/src/api.ts +++ b/plugins/code-coverage/src/api.ts @@ -48,8 +48,6 @@ export class CodeCoverageRestApi implements CodeCoverageApi { private readonly discoveryApi: DiscoveryApi; private readonly fetchApi: FetchApi; - private url: string = ''; - public constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi; @@ -61,10 +59,8 @@ export class CodeCoverageRestApi implements CodeCoverageApi { private async fetch( path: string, ): Promise { - if (!this.url) { - this.url = await this.discoveryApi.getBaseUrl('code-coverage'); - } - const resp = await this.fetchApi.fetch(`${this.url}${path}`); + const url = await this.discoveryApi.getBaseUrl('code-coverage'); + const resp = await this.fetchApi.fetch(`${url}${path}`); if (!resp.ok) { throw await ResponseError.fromResponse(resp); }