@@ -28,8 +28,12 @@ export class AppService {
2828 let gStatus = 0 ;
2929 this . logger . log ( 'start daemon' )
3030 for await ( const backend of this . backendsConfig ) {
31+ if ( job . name === "LISTBACKEND" ) {
32+ this . logger . log ( 'execute LISTBACKEND' )
33+ return { jobId :job . id , status :0 , data :this . backendsConfig }
34+ }
3135 if ( backend . active === 1 ) {
32- this . logger . log ( 'Execute backend ' + backend . name )
36+ this . logger . log ( 'Execute backend command ' + job . name + ' ' + backend . name )
3337 var task = backend . actions [ job . name ]
3438 this . logger . debug ( backend . path + '/bin/' + task . exec )
3539 const out = process . spawnSync ( backend . path + '/bin/' + task . exec , [ ] , {
@@ -42,11 +46,13 @@ export class AppService {
4246 result . output = out . stdout . toString ( )
4347 result . error = out . stderr . toString ( )
4448 results . push ( result ) ;
45- if ( task . onError == 'stop' ) {
49+ if ( task . onError === 'stop' && output . status != 0 ) {
50+ this . logger . log ( 'stop on Error ' )
4651 break
4752 }
4853 }
4954 }
55+ this . logger . debug ( 'results : ' )
5056 this . logger . debug ( results )
5157 return { jobId :job . id , status :gStatus , data :results }
5258 } , { connection :this . configService . get ( 'redis' ) } ) ;
@@ -59,6 +65,7 @@ export class AppService {
5965 . filter ( ( path , isDirectory ) => path . endsWith ( ".yml" ) )
6066 const files = crawler . crawl ( this . configService . get ( 'backendsPath' ) ) . sync ( ) . sort ( ) ;
6167 for await ( const element of files ) {
68+ this . logger . log ( 'Load ' + element )
6269 const file = fs . readFileSync ( element , 'utf8' )
6370 const config = YAML . parse ( file )
6471 try {
@@ -70,7 +77,7 @@ export class AppService {
7077 }
7178 config . path = path . dirname ( element )
7279 this . backendsConfig . push ( config )
73- this . logger . log ( 'Load ' + config . name )
80+ this . logger . log ( 'Loaded ' + config . name )
7481 }
7582 this . logger . debug ( this . backendsConfig )
7683
0 commit comments