2017-01-15 07:05:25 -07:00
# ! / u s r / b i n / e n v n o d e
2022-12-23 05:12:32 -07:00
import 'source-map-support/register' ;
2022-10-22 22:36:35 -06:00
import { instrument , shutdown as telemetryShutdown } from './instrumentation' ; // has to be imported before logger and other libraries which are instrumentalised
2021-04-09 08:16:00 -06:00
import { logger } from './logger' ;
2022-12-23 05:12:32 -07:00
import { bootstrap } from './proxy' ;
import { start } from './workers/global' ;
2017-01-15 07:05:25 -07:00
2021-04-09 08:16:00 -06:00
// istanbul ignore next
process . on ( 'unhandledRejection' , ( err ) = > {
logger . error ( { err } , 'unhandledRejection' ) ;
} ) ;
2022-12-23 05:12:32 -07:00
bootstrap ( ) ;
2019-06-28 01:18:05 -06:00
2020-04-09 04:47:48 -06:00
// eslint-disable-next-line @typescript-eslint/no-floating-promises
2019-11-24 00:43:24 -07:00
( async ( ) : Promise < void > = > {
2022-12-23 05:12:32 -07:00
process . exitCode = await instrument ( 'run' , ( ) = > start ( ) ) ;
2022-10-22 22:36:35 -06:00
await telemetryShutdown ( ) ; //gracefully shutdown OpenTelemetry
2021-03-16 06:34:43 -06:00
// istanbul ignore if
if ( process . env . RENOVATE_X_HARD_EXIT ) {
process . exit ( process . exitCode ) ;
}
2018-03-09 04:00:57 -07:00
} ) ( ) ;