File tree 1 file changed +3
-4
lines changed
src/Ignitor/SignalsListener
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
/**
11
11
* Exposes the API to invoke a callback when `SIGTERM` or
12
- * `SIGINT (pm2 only) ` signals are received.
12
+ * `SIGINT` signals are received.
13
13
*/
14
14
export class SignalsListener {
15
15
protected onCloseCallback ?: ( ) => Promise < void >
@@ -19,6 +19,7 @@ export class SignalsListener {
19
19
*/
20
20
private kill = async function ( ) {
21
21
try {
22
+ console . log ( 'Shutting down server...' )
22
23
await this . onCloseCallback ( )
23
24
process . exit ( 0 )
24
25
} catch ( error ) {
@@ -32,10 +33,8 @@ export class SignalsListener {
32
33
*/
33
34
public listen ( callback : ( ) => Promise < void > ) {
34
35
this . onCloseCallback = callback
35
- if ( process . env . pm_id ) {
36
- process . on ( 'SIGINT' , this . kill )
37
- }
38
36
37
+ process . on ( 'SIGINT' , this . kill )
39
38
process . on ( 'SIGTERM' , this . kill )
40
39
}
41
40
You can’t perform that action at this time.
0 commit comments