File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,21 @@ const server = dns2.createServer({
6565 } ) ;
6666
6767 if ( includes ( question . name , running ) ) return send ( response )
68+
69+ setTimeout ( ( ) => {
70+ running = without ( question . name , running )
71+ pp ( { running} )
72+ } , 1000 ) //should be healthcheck start interval
6873 running . push ( question . name )
6974
7075 await ( c . healthcheck ? exec ( c . healthcheck , { cwd : c . folder || '~' , stdio : 'inherit' } ) : Promise . reject ( { } ) )
76+ . then ( ( { stdout, stderr} ) => {
77+ running . push ( question . name )
78+ pp ( { healthcheck : 'ok' , stdout, stderr} )
79+ } )
7180 // .then(pp)
7281 . catch ( async ( { stdout, stderr} ) => {
82+ pp ( { healthcheck : 'fail' , stdout, stderr} )
7383 running = without ( question . name , running )
7484
7585 if ( c . start ) {
@@ -78,15 +88,15 @@ const server = dns2.createServer({
7888 return await exec ( c . start , { cwd : c . folder , stdio : 'inherit' } )
7989 . then ( pp )
8090 . catch ( ( { stderr} ) => {
81- pp ( { stderr, running } )
91+ pp ( { stderr} )
8292 onetimeServer ( { message : stderr , title : question . name + ' ' + c . start + ' error' } )
8393 } ) . then ( ( ) => {
84- pp ( { running } )
94+ send ( response )
8595 } )
8696 }
8797 } )
8898
89- return send ( response )
99+
90100 }
91101
92102
You can’t perform that action at this time.
0 commit comments