We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06aec10 commit 1d10faeCopy full SHA for 1d10fae
src/GenericRateLimiter.ts
@@ -43,6 +43,13 @@ export class GenericRateLimiter {
43
return resultHolder.isQuotaExceeded;
44
}
45
46
+ public async isQuotaAlreadyExceededDoNotRecordCall(qualifier: string): Promise<boolean> {
47
+ const timestampsSeconds = this.getTimestampsSeconds();
48
+ const record = await this.persistenceProvider.get(this.configuration.name, qualifier);
49
+ const recentUsages: number[] = this.selectRecentUsages(record.u, timestampsSeconds.threshold);
50
+ return this.isQuotaExceeded(recentUsages.length);
51
+ }
52
+
53
private runTransactionForAnswer(
54
input: PersistenceRecord,
55
resultHolder: { isQuotaExceeded: boolean },
0 commit comments