Expand description
Cross-platform rate limiting.
Buckets key on archivist:ratelimit:<fichub_user_id> when the caller is
linked to a FicHub account, so a spammer on Telegram gets throttled on
Discord/Matrix/Web simultaneously. When the user is not linked, the bucket
keys on archivist:ratelimit:<platform>:<ext_id> (per-platform fallback).
Sliding-window semantics are approximated with a simple fixed window:
INCR + EXPIRE; when the counter exceeds limit inside the window the
call is rejected.
Structs§
- Rate
Limiter - Rate limiter over the shared Redis instance.
Constants§
- DEFAULT_
LIMIT - Default max commands per window per user.
- DEFAULT_
WINDOW_ SECS - Default window length (seconds).