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