refactor(core): Unify error reporters in core and task runners (#12168)

Co-authored-by: Tomi Turtiainen <10324676+tomi@users.noreply.github.com>
This commit is contained in:
Iván Ovejero
2024-12-13 17:34:37 +01:00
committed by GitHub
parent d937e5abe8
commit 120499291d
7 changed files with 33 additions and 175 deletions

View File

@@ -34,7 +34,7 @@ import { WorkflowHistoryManager } from '@/workflows/workflow-history/workflow-hi
export abstract class BaseCommand extends Command {
protected logger = Container.get(Logger);
protected readonly errorReporter = Container.get(ErrorReporter);
protected errorReporter: ErrorReporter;
protected externalHooks?: ExternalHooks;
@@ -60,7 +60,11 @@ export abstract class BaseCommand extends Command {
protected needsCommunityPackages = false;
async init(): Promise<void> {
await this.errorReporter.init();
this.errorReporter = Container.get(ErrorReporter);
await this.errorReporter.init(
this.instanceSettings.instanceType,
this.globalConfig.sentry.backendDsn,
);
initExpressionEvaluator();
process.once('SIGTERM', this.onTerminationSignal('SIGTERM'));