renovate/lib/renovate.ts

26 lines
807 B
TypeScript
Raw Normal View History

2017-01-15 14:05:25 +00:00
#!/usr/bin/env node
2022-12-23 12:12:32 +00:00
import 'source-map-support/register';
import { instrument, shutdown as telemetryShutdown } from './instrumentation'; // has to be imported before logger and other libraries which are instrumentalised
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
// istanbul ignore next
process.on('unhandledRejection', (err) => {
logger.error({ err }, 'unhandledRejection');
});
2022-12-23 12:12:32 +00:00
bootstrap();
// eslint-disable-next-line @typescript-eslint/no-floating-promises
(async (): Promise<void> => {
2022-12-23 12:12:32 +00:00
process.exitCode = await instrument('run', () => start());
await telemetryShutdown(); //gracefully shutdown OpenTelemetry
// istanbul ignore if
if (process.env.RENOVATE_X_HARD_EXIT) {
process.exit(process.exitCode);
}
})();