Files
nginx-ui/cloudflare/tsconfig.json
0xJacky 9b1433318c fix(demo): recover a container the platform still calls healthy
An instance sat 'running' for nineteen hours with nothing bound to 8080.
Every request got the platform's own "container is not listening" error,
getState() reported 'healthy' throughout, and the demo never came back.

ready() returned early on a healthy state, so the only path that starts a
container was unreachable exactly when the container needed starting. The
platform's view of a container is not the truth, and this code treated it
as if it were.

A container that reports healthy without serving for a full boot window is
now stopped so the next request starts a fresh one, escalating to a kill if
the stop changes nothing. Deliberately slow to trigger and rate limited:
stopping a container that is merely slow to boot is how an earlier version
of this file put the loading page into a permanent refresh loop, so the
decision lives in a pure function with tests that assert two recoveries can
never land closer together than one cooldown.

Also stops the same outage from generating its own load. The loading page
polled /__demo/status forever, and each poll probed the container twice —
once via status(), once via ready() — so every open tab added two platform
error events per second to a container that was already down. status() now
drives the start itself, probes are cached for a couple of seconds, and the
page stops polling after five minutes instead of never.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 08:52:28 +08:00

19 lines
510 B
JSON

{
"compilerOptions": {
"target": "es2022",
"lib": ["es2022"],
"module": "es2022",
"moduleResolution": "bundler",
"types": ["@cloudflare/workers-types"],
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"isolatedModules": true,
"verbatimModuleSyntax": true
},
"include": ["src/**/*.ts"],
// Tests import bun:test, whose types are not part of the Workers runtime
// this project typechecks against. `bun test` runs them.
"exclude": ["src/**/*.test.ts"]
}