Repository navigation
Add quota controls and harden review processing - #166
devarshishimpi wants to merge 1 commit into
Conversation
| const body = comment.body | ||
| .replace(/\|/g, "\\|") |
There was a problem hiding this comment.
Codra Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7f43833b8
ℹ️ About Codra in GitHub
Your team has set up Codra to review pull requests in this repo. Reviews are triggered when you:
- Open a pull request for review
- Mark a draft as ready
If Codra has suggestions, it will comment; otherwise it will react with 👍.
| return dbStorage.run(createDbClient(env), fn); | ||
| export function runWithDb<T>(env: DbEnv, fn: () => T, client?: DbClient): T { | ||
| const resolvedClient = | ||
| client ?? (env.workerMode === false ? getDb(env) : createDbClient(env)); |
There was a problem hiding this comment.
Uncached database client created per runWithDb call in worker mode
When env.workerMode is not false and no client is explicitly passed to runWithDb, createDbClient(env) is invoked directly. Unlike getDb, this newly created client is neither cached nor registered for cleanup, resulting in a persistent database connection pool leak on every invocation.
| client ?? (env.workerMode === false ? getDb(env) : createDbClient(env)); | |
| client ?? getDb(env); |
| } | ||
| await this.queue.send(nextParams, { | ||
| delaySeconds: result.delaySeconds, | ||
| delaySeconds: 0, |
There was a problem hiding this comment.
Job delaySeconds overridden with zero
The change hardcodes delaySeconds to 0 instead of using result.delaySeconds. This discards any backoff or scheduled delay requested by the orchestrator result, which may cause aggressive retry loops or immediate execution when a delay was expected.
| delaySeconds: 0, | |
| delaySeconds: result.delaySeconds, |
Description
Adds configurable subrequest limits for Cloudflare Workers and Node.js, plus default KV-backed quotas for review and retry actions. Improves GitHub review posting by salvaging valid inline comments when GitHub rejects some comments and preserving dropped findings in the review summary. Also improves Node.js database-client reuse and shutdown, separates unit and integration test commands, and updates contributing guidance for merging directly into
main.No new dependencies are required.
Type of change
How Has This Been Tested?
Checklist: