Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions lib/renovate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import 'source-map-support/register.js';
import './punycode.cjs';

void (async (): Promise<void> => {
// ⚠️ Don't add code before this!
// This has to be imported before logger and other libraries which are instrumented.
const otel = await import('./instrumentation/index.ts');
otel.init();
(await import('./proxy.ts')).bootstrap();

// prints and exits the process if --version or --help is passed
const { parseEarlyFlags } =
await import('./workers/global/config/parse/cli.ts');
parseEarlyFlags();

// has to be imported before logger and other libraries which are instrumentalised
const otel = await import('./instrumentation/index.ts');
otel.init();
(await import('./proxy.ts')).bootstrap();

const logger = await import('./logger/index.ts');
/* v8 ignore next 3 -- not easily testable */
/* v8 ignore next -- not easily testable */
process.on('unhandledRejection', (err) => {
logger.logger.error({ err }, 'unhandledRejection');
});
Expand All @@ -25,7 +26,7 @@ void (async (): Promise<void> => {
process.exitCode = await otel.instrument('run', start);
await otel.shutdown(); //gracefully shutdown OpenTelemetry

/* v8 ignore next 3 -- no test required */
/* v8 ignore if -- no test required */
if (process.env.RENOVATE_X_HARD_EXIT) {
process.exit(process.exitCode);
}
Expand Down
Loading