fix: extend edge trace idle timeout (#1346)
This commit is contained in:
@@ -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`);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user