File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
backend/matching/src/workers Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ async function clean() {
67
67
}
68
68
}
69
69
70
+ logger . info ( 'Process Healthy' ) ;
70
71
( function loop ( ) {
71
72
if ( stopSignal ) {
72
73
return ;
Original file line number Diff line number Diff line change @@ -15,11 +15,14 @@ export const initWorker = (name: string, io: Server) => {
15
15
const upperCaseName = name . replace ( / ^ [ A - Z a - z ] / , ( c ) => c . toUpperCase ( ) ) ;
16
16
worker . on ( 'message' , ( message ) => {
17
17
if ( typeof message . valueOf ( ) === 'string' ) {
18
- logger . info ( `[${ upperCaseName } ]: ${ message } ` ) ;
18
+ logger . info ( { pid : worker . pid } , `[${ upperCaseName } ]: ${ message } ` ) ;
19
19
return ;
20
20
}
21
21
const messagePayload = message . valueOf ( ) ;
22
- logger . info ( `[${ upperCaseName } ] WS Payload: ${ JSON . stringify ( messagePayload ) } ` ) ;
22
+ logger . info (
23
+ { pid : worker . pid } ,
24
+ `[${ upperCaseName } ]: WS Payload: ${ JSON . stringify ( messagePayload ) } `
25
+ ) ;
23
26
const { rooms, event, message : payload } = messagePayload as IChildProcessMessage ;
24
27
if ( event === MATCH_SVC_EVENT . DISCONNECT ) {
25
28
io . sockets . in ( rooms ) . disconnectSockets ( ) ;
@@ -28,7 +31,7 @@ export const initWorker = (name: string, io: Server) => {
28
31
io . sockets . in ( rooms ) . emit ( event , payload ) ;
29
32
} ) ;
30
33
worker . on ( 'exit' , ( code ) => {
31
- logger . error ( `${ upperCaseName } exited with code ${ code } .` ) ;
34
+ logger . error ( { pid : worker . pid } , `${ upperCaseName } exited with code ${ code } .` ) ;
32
35
nWorkers -= 1 ;
33
36
if ( nWorkers === 0 ) {
34
37
logger . info ( 'Main Process exiting.' ) ;
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ async function match() {
176
176
}
177
177
}
178
178
179
+ logger . info ( 'Process Healthy' ) ;
179
180
( function loop ( ) {
180
181
if ( stopSignal ) {
181
182
return ;
You can’t perform that action at this time.
0 commit comments