@@ -12,15 +12,11 @@ const workers: childProcess.ChildProcess[] = [];
1212
1313for ( let num = 0 ; num < division ; num ++ ) {
1414 workers . push (
15- childProcess . fork (
16- path . resolve ( __dirname , './service.js' ) ,
17- [ ] ,
18- {
19- execArgv : [ '--max-old-space-size=' + process . env . MEMORY_LIMIT ] ,
20- env : Object . assign ( { } , process . env , { WORK_NUMBER : num } ) ,
21- stdio : [ 'inherit' , 'inherit' , 'inherit' , 'ipc' ]
22- }
23- )
15+ childProcess . fork ( path . resolve ( __dirname , './service.js' ) , [ ] , {
16+ execArgv : [ '--max-old-space-size=' + process . env . MEMORY_LIMIT ] ,
17+ env : Object . assign ( { } , process . env , { WORK_NUMBER : num } ) ,
18+ stdio : [ 'inherit' , 'inherit' , 'inherit' , 'ipc' ]
19+ } )
2420 ) ;
2521}
2622
@@ -46,13 +42,10 @@ process.on('message', (message: Message) => {
4642workers . forEach ( worker => {
4743 worker . on ( 'message' , ( message : Message ) => {
4844 // set result from worker
49- result . set (
50- worker . pid ,
51- {
52- diagnostics : message . diagnostics . map ( NormalizedMessage . createFromJSON ) ,
53- lints : message . lints . map ( NormalizedMessage . createFromJSON )
54- }
55- ) ;
45+ result . set ( worker . pid , {
46+ diagnostics : message . diagnostics . map ( NormalizedMessage . createFromJSON ) ,
47+ lints : message . lints . map ( NormalizedMessage . createFromJSON )
48+ } ) ;
5649
5750 // if we have result from all workers, send merged
5851 if ( result . hasAll ( ) ) {
0 commit comments