srvx-nightly 0.10.1-20260117-190542-79d407f → 0.10.1-20260117-200546-7f593b7

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.
@@ -31,16 +31,26 @@ const gracefulShutdownPlugin = (server) => {
31
31
  const gracefulShutdown = config === true || !config?.gracefulTimeout ? Number.parseInt(process.env.SERVER_SHUTDOWN_TIMEOUT || "") || 3 : config.gracefulTimeout;
32
32
  const forceShutdown = config === true || !config?.forceTimeout ? Number.parseInt(process.env.SERVER_FORCE_SHUTDOWN_TIMEOUT || "") || 5 : config.forceTimeout;
33
33
  let isShuttingDown = false;
34
+ let forceClose;
34
35
  const shutdown = async () => {
35
- if (isShuttingDown) return;
36
+ if (isShuttingDown) {
37
+ forceClose?.();
38
+ return;
39
+ }
36
40
  isShuttingDown = true;
37
41
  const w = process.stderr.write.bind(process.stderr);
38
- w(gray(`\nShutting down server in ${gracefulShutdown}s...`));
42
+ w(gray(`\nShutting down server in ${gracefulShutdown}s... (press Ctrl+C again to force close)`));
39
43
  let timeout;
40
44
  await Promise.race([server.close().finally(() => {
41
45
  clearTimeout(timeout);
42
46
  w(gray(" Server closed.\n"));
43
47
  }), new Promise((resolve) => {
48
+ forceClose = () => {
49
+ clearTimeout(timeout);
50
+ w(gray("\nForce closing...\n"));
51
+ server.close(true);
52
+ resolve();
53
+ };
44
54
  timeout = setTimeout(() => {
45
55
  w(gray(`\nForce closing connections in ${forceShutdown}s...`));
46
56
  timeout = setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "srvx-nightly",
3
- "version": "0.10.1-20260117-190542-79d407f",
3
+ "version": "0.10.1-20260117-200546-7f593b7",
4
4
  "description": "Universal Server API based on web platform standards. Works seamlessly with Deno, Bun and Node.js.",
5
5
  "homepage": "https://srvx.h3.dev",
6
6
  "repository": "h3js/srvx",