refactor(core): Make Logger a service (no-changelog) (#7494)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-25 16:35:22 +02:00
committed by GitHub
parent db4e61ba24
commit 05586a900d
131 changed files with 761 additions and 919 deletions

View File

@@ -7,7 +7,7 @@ import type {
IRun,
ExecutionStatus,
} from 'n8n-workflow';
import { createDeferredPromise, LoggerProxy } from 'n8n-workflow';
import { createDeferredPromise } from 'n8n-workflow';
import type { ChildProcess } from 'child_process';
import type PCancelable from 'p-cancelable';
@@ -20,6 +20,7 @@ import type {
} from '@/Interfaces';
import { isWorkflowIdValid } from '@/utils';
import { ExecutionRepository } from '@db/repositories';
import { Logger } from '@/Logger';
@Service()
export class ActiveExecutions {
@@ -27,6 +28,8 @@ export class ActiveExecutions {
[index: string]: IExecutingWorkflowData;
} = {};
constructor(private readonly logger: Logger) {}
/**
* Add a new active execution
*/
@@ -225,7 +228,7 @@ export class ActiveExecutions {
async setStatus(executionId: string, status: ExecutionStatus): Promise<void> {
if (this.activeExecutions[executionId] === undefined) {
LoggerProxy.debug(
this.logger.debug(
`There is no active execution with id "${executionId}", can't update status to ${status}.`,
);
return;