Skip to content

Commit e7e6dfc

Browse files
committed
Clear any existing SIGINT listeners during startup
No issue -remove any existing listeners on the SIGINT event during the ghost bootstrap process. handles an issue during testing where node was warning about too many listeners.
1 parent d9f7aa2 commit e7e6dfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/server/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function ghostStartMessages() {
133133
);
134134

135135
// ensure that Ghost exits correctly on Ctrl+C
136-
process.on('SIGINT', function () {
136+
process.removeAllListeners('SIGINT').on('SIGINT', function () {
137137
console.log(
138138
"\nGhost has shut down".red,
139139
"\nYour blog is now offline"
@@ -150,7 +150,7 @@ function ghostStartMessages() {
150150
"\nCtrl+C to shut down".grey
151151
);
152152
// ensure that Ghost exits correctly on Ctrl+C
153-
process.on('SIGINT', function () {
153+
process.removeAllListeners('SIGINT').on('SIGINT', function () {
154154
console.log(
155155
"\nGhost has shutdown".red,
156156
"\nGhost was running for",

0 commit comments

Comments
 (0)