You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fc361a5
Browse filesBrowse the repository at this point in the historyBrowse files
feat(config): add worker.limits.cpu_ms per-project CPU limit
Adds a curated wrangler field to void.json so a project can set its own
Workers CPU cap:
- config.ts / schema.json: validate worker.limits as a strict object
(unknown keys rejected) with cpu_ms an integer in 1..300000
- deploy manifest: carry limits.cpuMs (manifest version stays 3, the
field is optional and additive)
- emit limits into buildVoidManifest and buildFrameworkManifest; static
manifests never carry limits
- also copy the value into the Cloudflare vite-plugin worker config so
the generated dist/ssr/wrangler.json enforces it on
`void deploy --backend cloudflare` (adversarial-review finding)
- docs: reference/config.md documents managed-platform semantics
(deploys above the plan ceiling reject; only rollback clamps) and the
self-hosted passthrough
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF8p6MCmgiE7e3LM1J8EQV
@@ -269,6 +270,18 @@ Curated Cloudflare Workers configuration. Cloudflare-targeted apps require an ex
269
270
270
271
`worker.vars` values must be strings. They are merged into Worker bindings before `.env` files are loaded, so project `.env` values override `worker.vars` for local dev/build. Do not put secrets here; use `env.ts` plus `void secret put` for production secrets.
271
272
273
+
`worker.limits.cpu_ms` caps Workers CPU time per request, in milliseconds. It must be an integer between 1 and 300000 (Cloudflare's hard maximum, 5 minutes). A deploy that requests more than your account plan's ceiling fails with an error naming both the requested value and the plan maximum. Only a rollback clamps: rolling back to a deployment whose configured limit now exceeds your plan applies the plan ceiling instead of failing. On the self-hosted path (`void deploy --backend cloudflare`, or a bare `wrangler deploy` of the build output), the value is written into the generated `dist/ssr/wrangler.json` as `limits.cpu_ms` and enforced by Cloudflare directly — no plan ceiling applies.
274
+
275
+
```json
276
+
{
277
+
"worker": {
278
+
"limits": {
279
+
"cpu_ms": 30000
280
+
}
281
+
}
282
+
}
283
+
```
284
+
272
285
### `routing`
273
286
274
287
Routing and edge configuration for headers, redirects, rewrites, and caching.
0 commit comments