File tree Expand file tree Collapse file tree
services/discord-proxy/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ import type { Logger } from 'pino';
1313 * on them would grow the map without bound -- one entry per dashboard visitor, forever. `services/api`
1414 * deliberately keeps its OAuth client pointed straight at Discord for this reason (see `discordAPI.ts`);
1515 * this is the safety net for anything that slips through.
16+ *
17+ * Pooling does mean these callers share one `globalRequestsPerSecond` budget, which is left at the default 50
18+ * rather than the `Infinity` the clients use. That's deliberate and costs nothing today: Discord's 50/s global
19+ * limit is per bot token and doesn't apply to token-less routes at all, so this is a self-imposed backstop
20+ * against runaway volume rather than a mirror of anything upstream. It notably cannot delay an interaction
21+ * callback -- `@discordjs/rest` routes `/interactions/:id/:token/callback` to a `BurstHandler`, which neither
22+ * reads nor decrements the global counter (only `SequentialHandler` does), so the 3s ack window is never at
23+ * this budget's mercy. Webhook execution is the only pooled traffic it can actually throttle.
1624 */
1725const POOLED_KEY = '' ;
1826
You can’t perform that action at this time.
0 commit comments