@bakery-framework/cli 2.5.0-alpha.1 → 2.5.0-alpha.2
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 +3 -3
- package/src/worker.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakery-framework/cli",
|
|
3
|
-
"version": "2.5.0-alpha.
|
|
3
|
+
"version": "2.5.0-alpha.2",
|
|
4
4
|
"description": "Bakery entry point and process supervision: mode dispatch, dev watcher, cluster.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bakery",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"bun": ">=1.4.4"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@bakery-framework/core": "^2.5.0-alpha.
|
|
42
|
+
"@bakery-framework/core": "^2.5.0-alpha.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@bakery-framework/orm": "^2.5.0-alpha.
|
|
45
|
+
"@bakery-framework/orm": "^2.5.0-alpha.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@bakery-framework/orm": {
|
package/src/worker.ts
CHANGED
|
@@ -137,6 +137,13 @@ if (import.meta.env.THREAD_WORKER) {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
// How long a connection may stay quiet before `Bun.serve` closes it. Bun's
|
|
141
|
+
// default is 10 s, and its timer closes the connection with no answer, not even
|
|
142
|
+
// a 5xx: a 20 s handler was reset at 11,979 ms on a new connection and 23,973 ms
|
|
143
|
+
// on a reused one, and the client saw only ECONNRESET. 60 s is nginx's default
|
|
144
|
+
// `proxy_read_timeout`, past which a proxied client gets a 504 anyway.
|
|
145
|
+
const IDLE_TIMEOUT_SECONDS = 60
|
|
146
|
+
|
|
140
147
|
// Same resolver `startup.ts`'s banner and the dev master's URL use, so what we
|
|
141
148
|
// bind and what they advertise cannot disagree. It throws on a malformed
|
|
142
149
|
// `PORT` rather than handing `Bun.serve` a `NaN` it silently turns into a
|
|
@@ -262,6 +269,7 @@ try {
|
|
|
262
269
|
reusePort:
|
|
263
270
|
process.platform !== 'win32' && Boolean(import.meta.env.THREAD_WORKER),
|
|
264
271
|
maxRequestBodySize: Bakery.config.maxBodySize,
|
|
272
|
+
idleTimeout: IDLE_TIMEOUT_SECONDS,
|
|
265
273
|
|
|
266
274
|
async fetch(req) {
|
|
267
275
|
// Memoized for the lifetime of the request: the router, body parser and
|