diff --git a/dev-packages/ovsx-client/src/ovsx-http-client.ts b/dev-packages/ovsx-client/src/ovsx-http-client.ts index 087c550d16d7a..bfbcc4cad41c8 100644 --- a/dev-packages/ovsx-client/src/ovsx-http-client.ts +++ b/dev-packages/ovsx-client/src/ovsx-http-client.ts @@ -48,6 +48,7 @@ export class OVSXHttpClient implements OVSXClient { protected async requestJson(url: string): Promise { const attempts = 5; + let warn = true; for (let i = 0; i < attempts; i++) { await this.rateLimiter.removeTokens(i + 1); const context = await this.requestService.request({ @@ -55,7 +56,10 @@ export class OVSXHttpClient implements OVSXClient { headers: { 'Accept': 'application/json' } }); if (context.res.statusCode === 429) { - console.warn('OVSX rate limit exceeded. Will perform request with higher timeout. Consider reducing the rate limit.'); + if (warn) { + warn = false; + console.warn('OVSX rate limit exceeded. Will perform request with higher timeout. Consider reducing the rate limit.'); + } if (i < attempts - 1) { continue; }