Skip to content

Commit 94e5274

Browse files
committed
chore: describe the Redis-only provider admission store and trim the 0470 header
1 parent 4ad904d commit 94e5274

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

‎apps/sim/lib/core/rate-limiter/provider-admission.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export class ProviderAdmissionTimeoutError extends Error {
6565
/**
6666
* Shared per-credential admission for indexing workers and interactive callers.
6767
* These are deployment operating budgets, not claims about provider quotas.
68-
* Redis and PostgreSQL use the same durable token buckets; storage errors fail
69-
* before the provider request. Capacity is spent only when every dimension and
68+
* The token buckets live in Redis; storage errors fail before the provider
69+
* request. Capacity is spent only when every dimension and
7070
* the shared provider cooldown permit the request in one atomic operation.
7171
*/
7272
export async function waitForProviderAdmission(input: ProviderAdmissionInput): Promise<void> {

‎packages/db/migrations/0470_contract_whitelabel_and_rate_limit_bucket.sql‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
-- Contracts the two objects v0.9.65 stopped declaring and using. organization.whitelabel_settings was
2-
-- un-declared in 0468 (#10269) and rate_limit_bucket's Postgres token bucket and provider-capacity store
3-
-- were removed when Redis became required (#10272). rate_limit_bucket has no FKs in either direction.
41
-- Each drop autocommits under a short lock timeout so a busy table fails fast for migrate.ts to retry
5-
-- rather than queue traffic behind its ACCESS EXCLUSIVE lock.
2+
-- rather than queue traffic behind its ACCESS EXCLUSIVE lock. rate_limit_bucket has no FKs.
63
COMMIT;--> statement-breakpoint
74
SET lock_timeout = '100ms';--> statement-breakpoint
85
-- migration-safe: contract of #10269 (shipped in v0.9.65): whitelabeling was removed and no release from v0.9.65 on declares, reads, or writes whitelabel_settings.

0 commit comments

Comments
 (0)