nitropack-nightly 2.11.2-20250305-141326.058819aa → 2.11.2-20250305-183631.5b5e10e7

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.
@@ -2247,6 +2247,7 @@ function createHTTPProxy(defaults = {}) {
2247
2247
  });
2248
2248
  const handleEvent = async (event, opts = {}) => {
2249
2249
  try {
2250
+ event._handled = true;
2250
2251
  await proxy.web(event.node.req, event.node.res, opts);
2251
2252
  } catch (error) {
2252
2253
  if (error?.code !== "ECONNRESET") {
@@ -2287,7 +2288,6 @@ class NodeDevWorker {
2287
2288
  statusText: "Dev worker is unavailable"
2288
2289
  });
2289
2290
  }
2290
- event._handled = true;
2291
2291
  await this.#proxy.handleEvent(event, { target: this.#address });
2292
2292
  }
2293
2293
  handleUpgrade(req, socket, head) {
@@ -2360,7 +2360,7 @@ class NodeDevWorker {
2360
2360
  return;
2361
2361
  }
2362
2362
  this.#worker.postMessage({ event: "shutdown" });
2363
- if (!this.#worker._exitCode) {
2363
+ if (!this.#worker._exitCode && !isTest && !isCI) {
2364
2364
  await new Promise((resolve) => {
2365
2365
  const gracefulShutdownTimeoutSec = Number.parseInt(process.env.NITRO_SHUTDOWN_TIMEOUT || "", 10) || 5;
2366
2366
  const timeout = setTimeout(() => {
@@ -1,3 +1,3 @@
1
- const version = "2.11.2-20250305-141326.058819aa";
1
+ const version = "2.11.2-20250305-183631.5b5e10e7";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.2-20250305-141326.058819aa";
1
+ const version = "2.11.2-20250305-183631.5b5e10e7";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "2.11.2-20250305-141326.058819aa";
1
+ const version = "2.11.2-20250305-183631.5b5e10e7";
2
2
 
3
3
  export { version };
@@ -79,8 +79,12 @@ nitroApp.router.use(
79
79
  })
80
80
  );
81
81
  trapUnhandledNodeErrors();
82
- async function onShutdown(signal) {
83
- await nitroApp.hooks.callHook("close");
82
+ async function onShutdown() {
83
+ server.closeAllConnections?.();
84
+ await Promise.all([
85
+ new Promise((resolve) => listener.close(resolve)),
86
+ nitroApp.hooks.callHook("close").catch(console.error)
87
+ ]);
84
88
  }
85
89
  parentPort?.on("message", async (msg) => {
86
90
  if (msg && msg.event === "shutdown") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.11.2-20250305-141326.058819aa",
3
+ "version": "2.11.2-20250305-183631.5b5e10e7",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",