Added logic to persist session keys across restarts Added dynamic rate limiting
Rate Limit Improvements #2
expand 3 commits
hide 3 commits
This commit introduces Redis caching to prevent redundant moderation
actions, reducing the load on the Bluesky API.
- Added the `redis` package as a dependency. - Implemented
`connectRedis` and `disconnectRedis` functions to manage the Redis
connection. - Added `tryClaimPostLabel`, `tryClaimAccountLabel`, and
`tryClaimAccountComment` functions to manage and claim resources for
caching purposes. - Modified `src/config.ts` to include the `REDIS_URL`
environment variable. - Added `src/redis.ts` which contains the Redis
client and connection management. - Integrated the caching logic into
moderation functions to ensure that actions are performed only once per
resource. - Added Redis healthcheck to compose.yaml. - Updated
package.json and bun.lock.
- Stores and restores session for persistent login - Implements dynamic
rate limiting from ATP headers - Adds Prometheus metrics for rate limit
state and waits - Refactors authentication flow for session persistence