Skip to content

Commit fc8eac8

Browse files
committed
Simplify example callbacks
1 parent 9fc8bc9 commit fc8eac8

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

examples/webapp.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,7 @@ function closePoolAndExit() {
226226
}
227227

228228
process
229-
.on('SIGTERM', function() {
230-
closePoolAndExit();
231-
})
232-
.on('SIGINT', function() {
233-
closePoolAndExit();
234-
});
229+
.on('SIGTERM', closePoolAndExit)
230+
.on('SIGINT', closePoolAndExit);
235231

236232
init();

examples/webappawait.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,7 @@ async function closePoolAndExit() {
199199
}
200200

201201
process
202-
.on('SIGTERM', function() {
203-
closePoolAndExit();
204-
})
205-
.on('SIGINT', function() {
206-
closePoolAndExit();
207-
});
202+
.on('SIGTERM', closePoolAndExit)
203+
.on('SIGINT', closePoolAndExit);
208204

209205
init();

examples/webapppromises.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,7 @@ function closePoolAndExit() {
219219
}
220220

221221
process
222-
.on('SIGTERM', function() {
223-
closePoolAndExit();
224-
})
225-
.on('SIGINT', function() {
226-
closePoolAndExit();
227-
});
222+
.on('SIGTERM', closePoolAndExit)
223+
.on('SIGINT', closePoolAndExit);
228224

229225
init();

0 commit comments

Comments
 (0)