Skip to content

Commit

Permalink
fix(ratelimit/client.ts): ensure cache check includes async flag befo…
Browse files Browse the repository at this point in the history
…re fetching data
  • Loading branch information
chronark committed Aug 6, 2024
1 parent 4b5a4ad commit 4a74287
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/api/src/pkg/ratelimit/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class AgentRatelimiter implements RateLimiter {
return a;
})();

if (!req.async) {
if (!this.cache.has(id) || !req.async) {
const res = await p;
if (res.val) {
this.setCacheMax(id, res.val.current);
Expand Down

0 comments on commit 4a74287

Please sign in to comment.