@@ -10,14 +10,14 @@ import { ActionType } from './_enum/action-type.enum';
1010import { ExecutorConfigInterface } from '~/_common/interfaces/executor-config.interface' ;
1111import Redis from 'ioredis' ;
1212import { DumpPackageConfigExecutor } from './_executors/dump-package-config.executor' ;
13- import { PackageJson } from 'types-package-json' ;
13+ // import { PackageJson } from 'types-package-json';
1414import { readFileSync } from 'node:fs' ;
1515//import { PackageJson } from 'types-package-json';
1616//import { readFileSync } from 'node:fs';
1717
1818@Injectable ( )
1919export class BackendRunnerService implements OnApplicationBootstrap , OnModuleInit {
20- protected _package : Partial < PackageJson > ;
20+ protected _package : Partial < any > ;
2121 private readonly _logger = new Logger ( BackendRunnerService . name ) ;
2222
2323 protected executors : Map < string , ExecutorInterface > = new Map < string , ExecutorInterface > ( ) ;
@@ -30,7 +30,7 @@ export class BackendRunnerService implements OnApplicationBootstrap, OnModuleIni
3030 return this . _logger ;
3131 }
3232
33- public get packageJson ( ) : Partial < PackageJson > {
33+ public get packageJson ( ) : Partial < any > {
3434 return this . _package ;
3535 }
3636
@@ -43,13 +43,14 @@ export class BackendRunnerService implements OnApplicationBootstrap, OnModuleIni
4343 private readonly _backendsConfig : BackendConfigService ,
4444 @InjectRedis ( ) private readonly redis : Redis ,
4545 ) {
46- try {
47-
48- this . _package = JSON . parse ( readFileSync ( 'package.json' , 'utf-8' ) ) ;
49- } catch ( e ) {
50- this . _logger . error ( 'Error reading package.json file: ' , e ) ;
51- this . _package = { } ;
52- }
46+ console . log ( 'pkg' , ( process as any ) . pkg )
47+ this . _package = { } ;
48+ // try {
49+ // this._package = JSON.parse(readFileSync('package.json', 'utf-8'));
50+ // } catch (e) {
51+ // this._logger.error('Error reading package.json file: ', e);
52+ // this._package = {};
53+ // }
5354 }
5455
5556 public async onModuleInit ( ) {
@@ -77,13 +78,14 @@ export class BackendRunnerService implements OnApplicationBootstrap, OnModuleIni
7778 this . logger . verbose ( `Job ${ job . name } executed with status ${ result . status } ` ) ;
7879
7980 if ( result . status !== 0 ) {
80- this . logger . error ( `Job ${ job . name } failed with status ${ result . status } ` ) ;
8181 const errMsg = [ ]
82+ this . logger . error ( `Job ${ job . name } failed with status ${ result . status } ` ) ;
83+
8284 for ( const data of result . data ) {
8385 errMsg . push ( data ?. error ?. message || 'No error message' ) ;
8486 }
8587
86- throw new UnrecoverableError ( `Job ${ job . name } failed with status ${ result . status } : ${ errMsg . join ( ', ' ) } ` ) ;
88+ return result ;
8789 }
8890
8991 this . logger . log ( `Job ${ job . name } success with status ${ result . status } ` ) ;
0 commit comments