fix(adapter.node): unref the node server before closing connections during shutdown

This commit is contained in:
2026-03-23 11:17:59 +00:00
parent 8b02e8d002
commit bbc569b628
3 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
# Changelog
## 2026-03-23 - 2.0.3 - fix(adapter.node)
unref the node server before closing connections during shutdown
- Calls server.unref() before closing all connections so shutdown does not keep the Node.js event loop alive.
- Improves shutdown behavior for the Node adapter when stopping HTTP or HTTPS servers.
## 2026-03-23 - 2.0.2 - fix(adapter.node)
close websocket server and active connections when stopping the Node adapter

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartserve',
version: '2.0.2',
version: '2.0.3',
description: 'a cross platform server module for Node, Deno and Bun'
}

View File

@@ -99,6 +99,7 @@ export class NodeAdapter extends BaseAdapter {
}
return new Promise((resolve, reject) => {
if (this.server) {
this.server.unref();
this.server.closeAllConnections();
this.server.close((err) => {
if (err) reject(err);