Skip to content

Commit

Permalink
remove additional option to be sure it has no effects
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Jul 6, 2024
1 parent 4681618 commit 4a9f862
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/onecta/oidc-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ export class OnectaClient {
async requestResource(path: string, opts?: RequestParameters): Promise<any> {
if (!opts?.ignoreRateLimit && this.#blockedUntil > Date.now()) {
const retryAfter = Math.ceil((this.#blockedUntil - Date.now()) / 1000);
throw new RateLimitedError(`API request rate-limited, retry after ${retryAfter} seconds`, retryAfter);
throw new RateLimitedError(`API request still rate-limited, retry after ${retryAfter} seconds`, retryAfter);
}
const reqOpts = { ...opts };
delete reqOpts.ignoreRateLimit;
const tokenSet = await this.#getTokenSetQueued();
const url = `${OnectaAPIBaseUrl.prod}${path}`;
const res = await this.#client.requestResource(url, tokenSet, opts);
const res = await this.#client.requestResource(url, tokenSet, reqOpts);
RESOLVED.then(() => this.#emitter.emit('rate_limit_status', this.#getRateLimitStatus(res)));
switch (res.statusCode) {
case 200:
Expand Down

0 comments on commit 4a9f862

Please sign in to comment.