mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-09-24 23:14:56 -04:00
/api/v1/activities is the single busiest route in production: 216 of 1101 requests in a 14 minute log window, 19.6% of all traffic and 21.7% of non-asset traffic. It was the only high-volume route with no rate limit, since the throttle matched plantings, harvests and members only. Collapses the two alternations into one regex with an optional /api/v1 prefix, so the HTML and API routes stay in step instead of being listed twice. Verified equivalent to the old pair across both route families plus their edge cases: /plantingsfoo, /memberships, /foo/plantings and /api/v2/activities are still unmatched. Note this does not by itself stop the client currently polling that endpoint. It makes 189 requests over 21 minutes, about 9 per minute, which is under the 15 per minute limit, and Rack::Attack counters live in per-worker memory so at WEB_CONCURRENCY=2 each worker sees only half of them. This closes the hole rather than fixing today's load. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>