Media / foldkit-media/cloudflare

admissionRateLimit

function · packages/media/src/cloudflare/index.ts:218

function admissionRateLimit(
  binding: RateLimit,
  options?: {
    readonly retryAfterSeconds?: number
  },
): Layer.Layer<Admission>

Admission through a Workers rate-limit binding ([[ratelimits]]), whose limit and period are its configuration. It answers yes or no, not when, so a refusal says to retry after retryAfterSeconds (the binding's period, 60 by default). A binding that fails admits the request, logged.