Skip to content

Commit

Permalink
fix: remove process listeners after stopping the server
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 8, 2021
1 parent 270da15 commit 447fe4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Server.js
Expand Up @@ -2258,6 +2258,11 @@ class Server {
this.middleware = null;
}
}

// We add listeners to signals when creating a new Server instance
// So ensure they are removed to prevent EventEmitter memory leak warnings
process.removeAllListeners("SIGINT");
process.removeAllListeners("SIGTERM");
}

stopCallback(callback) {
Expand Down

0 comments on commit 447fe4d

Please sign in to comment.