1tube 0.1.52 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/gateway/body-watchdog.ts +1 -1
- package/src/server.ts +4 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `Deno.serve` does not enforce a per-request body-read timeout. A client that
|
|
5
5
|
* dribbles bytes at a few per second can occupy a request slot for the full
|
|
6
|
-
* `FUNCTION_TIMEOUT_MS` (default
|
|
6
|
+
* `FUNCTION_TIMEOUT_MS` (default 800 s), starving real traffic. We don't want
|
|
7
7
|
* to *cap total body read time* — large but fast uploads are fine — we want
|
|
8
8
|
* to detect *stalled progress*: too long a gap between consecutive chunks.
|
|
9
9
|
*
|
package/src/server.ts
CHANGED
|
@@ -426,8 +426,11 @@ function parseArgs(): CliOpts {
|
|
|
426
426
|
// Normalized at the end via setRoutePrefix(); kept raw here so an
|
|
427
427
|
// explicit CLI flag can still override the env var.
|
|
428
428
|
let routePrefix = Deno.env.get("1TUBE_ROUTE_PREFIX") || "/functions/v1";
|
|
429
|
+
// Matches Vercel Fluid's maxDuration cap. Per-function `serve({ timeoutMs })`
|
|
430
|
+
// / `1tube.json` still override. `FUNCTION_TIMEOUT_MS` / `--timeout` win last.
|
|
431
|
+
const DEFAULT_FUNCTION_TIMEOUT_MS = 800_000;
|
|
429
432
|
let defaultTimeoutMs = parseInt(
|
|
430
|
-
Deno.env.get("FUNCTION_TIMEOUT_MS") ||
|
|
433
|
+
Deno.env.get("FUNCTION_TIMEOUT_MS") || String(DEFAULT_FUNCTION_TIMEOUT_MS),
|
|
431
434
|
10,
|
|
432
435
|
);
|
|
433
436
|
const bodyLimitMb = parseFloat(Deno.env.get("1TUBE_BODY_LIMIT_MB") || "30");
|