fix: extend edge trace idle timeout (#1346)

This commit is contained in:
Lyon
2026-06-16 22:50:25 +08:00
committed by GitHub
parent 32a2e2d39f
commit 0cd238c795
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ test("edge proxy reports local health and proxies live health to upstream", asyn
assert.equal(health.status, "ok");
assert.equal(health.service.role, "public-dev-ingress");
assert.equal(health.details.upstream, `http://127.0.0.1:${upstream.port}`);
assert.equal(health.details.idleTimeoutSeconds, 120);
assert.equal(health.details.mode, "dev-edge-proxy");
const routes = await fetchJson(`http://127.0.0.1:${proxy.port}/routes`);
+6
View File
@@ -10,6 +10,10 @@ const proxyTimeoutMs = parseTimeout(process.env.HWLAB_EDGE_PROXY_TIMEOUT_MS, 126
min: 1000,
max: 2400000
});
const idleTimeoutSeconds = parseTimeout(process.env.HWLAB_EDGE_IDLE_TIMEOUT_SECONDS, 120, {
min: 1,
max: 255
});
const { host, port } = resolveHostPort({
listenEnv: "HWLAB_EDGE_LISTEN",
hostEnv: "HWLAB_EDGE_HOST",
@@ -21,6 +25,7 @@ function proxyDetails() {
return {
upstream,
timeoutMs: proxyTimeoutMs,
idleTimeoutSeconds,
mode: "dev-edge-proxy"
};
}
@@ -34,6 +39,7 @@ function parseTimeout(value, fallback, { min, max }) {
const server = Bun.serve({
hostname: host,
port,
idleTimeout: idleTimeoutSeconds,
async fetch(request, bunServer) {
const url = new URL(request.url);