Skip to main content

RateLimitGuardDeps

@forge/monorepo


@forge/monorepo / backend/src / RateLimitGuardDeps

Type Alias: RateLimitGuardDeps

RateLimitGuardDeps = object

Defined in: backend/src/usage/rate-limit.ts:117

Properties

now?

readonly optional now?: () => number

Defined in: backend/src/usage/rate-limit.ts:127

Returns

number


observer?

readonly optional observer?: RateLimitObserver

Defined in: backend/src/usage/rate-limit.ts:126


policyFor

readonly policyFor: (context) => Promise<RateLimitPolicy | undefined> | RateLimitPolicy | undefined

Defined in: backend/src/usage/rate-limit.ts:125

The policy for this tenant, or undefined for unlimited.

A function rather than a value, for the reason QuotaGuardDeps gives: limits are per tenant and change without a redeploy, and a value captured at construction would be the limits of whoever booted the process.

Parameters

context

ExecutionContext

Returns

Promise<RateLimitPolicy | undefined> | RateLimitPolicy | undefined


store

readonly store: RateLimitStore

Defined in: backend/src/usage/rate-limit.ts:118