File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -35,31 +35,31 @@ const runWorker = async (args: CliArgs) => {
35
35
logger . info ( 'SIGINT received in CLI' ) ;
36
36
// allow C-c C-c for force interrupt
37
37
process . once ( 'SIGINT' , ( ) => {
38
- logger . info ( 'worker closed forcefully' ) ;
38
+ logger . info ( 'worker closed forcefully due to SIGINT. Calling process.exit() ' ) ;
39
39
process . exit ( 130 ) ; // SIGINT exit code
40
40
} ) ;
41
41
if ( args . production ) {
42
42
await worker . drain ( ) ;
43
43
}
44
44
await worker . close ( ) ;
45
- logger . info ( 'worker closed' ) ;
45
+ logger . info ( 'worker closed due to SIGINT. Calling process.exit() ' ) ;
46
46
process . exit ( 130 ) ; // SIGINT exit code
47
47
} ) ;
48
48
49
49
process . once ( 'SIGTERM' , async ( ) => {
50
- logger . info ( 'SIGTERM received in CLI' ) ;
50
+ logger . info ( 'SIGTERM received in CLI. ' ) ;
51
51
if ( args . production ) {
52
52
await worker . drain ( ) ;
53
53
}
54
54
await worker . close ( ) ;
55
- logger . info ( 'worker closed' ) ;
55
+ logger . info ( 'worker closed from SIGTERM. Calling process.exit() ' ) ;
56
56
process . exit ( 143 ) ; // SIGTERM exit code
57
57
} ) ;
58
58
59
59
try {
60
60
await worker . run ( ) ;
61
61
} catch {
62
- logger . fatal ( 'worker failed ' ) ;
62
+ logger . fatal ( 'closing worker due to error. Calling process.exit() ' ) ;
63
63
process . exit ( 1 ) ;
64
64
}
65
65
} ;
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ const ORPHANED_TIMEOUT = 15 * 1000;
49
49
const closeEvent = new EventEmitter ( ) ;
50
50
51
51
const orphanedTimeout = setTimeout ( ( ) => {
52
- logger . warn ( 'process orphaned, shutting down' ) ;
52
+ logger . warn ( 'process orphaned, shutting down. Calling process.exit() ' ) ;
53
53
process . exit ( ) ;
54
54
} , ORPHANED_TIMEOUT ) ;
55
55
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ const startJob = (
112
112
await Promise . all ( shutdownTasks ) . catch ( ( ) => logger . error ( 'error while shutting down the job' ) ) ;
113
113
114
114
process . send ! ( { case : 'done' } ) ;
115
+ logger . info ( 'job completed calling process.exit()' ) ;
115
116
process . exit ( ) ;
116
117
} ) ;
117
118
@@ -171,7 +172,7 @@ const startJob = (
171
172
const closeEvent = new EventEmitter ( ) ;
172
173
173
174
const orphanedTimeout = setTimeout ( ( ) => {
174
- logger . warn ( 'process orphaned, shutting down' ) ;
175
+ logger . warn ( 'process orphaned, shutting down. Calling process.exit() ' ) ;
175
176
process . exit ( ) ;
176
177
} , ORPHANED_TIMEOUT ) ;
177
178
You can’t perform that action at this time.
0 commit comments