aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/renovate.ts
blob: 4a618b9a385f83e3ed0ee7580c9721c2acbb510a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node

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';
import { bootstrap } from './proxy';
import { start } from './workers/global';

// istanbul ignore next
process.on('unhandledRejection', (err) => {
  logger.error({ err }, 'unhandledRejection');
});

bootstrap();

// eslint-disable-next-line @typescript-eslint/no-floating-promises
(async (): Promise<void> => {
  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);
  }
})();