File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ const options = { trackUnmanagedFds: true };
1212
1313( async ( ) => {
1414 const config = await new Config ( CFG_PATH ) ;
15- const { sections } = config ;
16- const count = sections . server . ports . length ;
15+ const count = config . sections . server . ports . length ;
1716 const workers = new Array ( count ) ;
1817
1918 const start = id => {
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ export class Metacom {
99 const packet = JSON . parse ( data ) ;
1010 const { callback, event } = packet ;
1111 const callId = callback || event ;
12- const [ resolve , reject ] = this . calls . get ( callId ) ;
12+ const promised = this . calls . get ( callId ) ;
13+ if ( ! promised ) return ;
14+ const [ resolve , reject ] = promised ;
1315 if ( packet . error ) {
1416 const { code, message } = packet . error ;
1517 const error = new Error ( message ) ;
@@ -39,9 +41,8 @@ export class Metacom {
3941 headers : { 'Content-Type' : 'application/json' } ,
4042 body : JSON . stringify ( packet ) ,
4143 } ) . then ( res => {
42- const { status } = res ;
43- if ( status === 200 ) return res . json ( ) . then ( ( { result } ) => result ) ;
44- throw new Error ( `Status Code: ${ status } ` ) ;
44+ if ( res . status === 200 ) return res . json ( ) . then ( ( { result } ) => result ) ;
45+ throw new Error ( `Status Code: ${ res . status } ` ) ;
4546 } ) ;
4647 } ;
4748 }
You can’t perform that action at this time.
0 commit comments