Added logic to persist session keys across restarts Added dynamic rate limiting
+1
compose.yaml
+107
-7
src/agent.ts
+115
-8
src/limits.ts
+62
src/session.ts
+255
-18
src/tests/agent.test.ts
+200
-21
src/tests/limits.test.ts
+183
src/tests/session.test.ts
History
1 round
0 comments
3 commits
expand
collapse
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