Skip to content

Commit

Permalink
Apply review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed Oct 21, 2024
1 parent 0001967 commit ca2e143
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class Start extends BaseCommand {

this.logger.info('Initializing n8n process');
if (config.getEnv('executions.mode') === 'queue') {
const scopedLogger = this.logger.scoped(['scaling']);
const scopedLogger = this.logger.scoped('scaling');
scopedLogger.debug('Starting main instance in scaling mode');
scopedLogger.debug(`Host ID: ${this.instanceSettings.hostId}`);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Worker extends BaseCommand {

super(argv, cmdConfig);

this.logger = Container.get(Logger).scoped(['scaling']);
this.logger = Container.get(Logger).scoped('scaling');
}

async init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class ConcurrencyControlService {
private readonly telemetry: Telemetry,
private readonly eventService: EventService,
) {
this.logger = this.logger.scoped(['concurrency']);
this.logger = this.logger.scoped('concurrency');

this.productionLimit = config.getEnv('executions.concurrency.productionLimit');

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class License {
private readonly licenseMetricsService: LicenseMetricsService,
private readonly globalConfig: GlobalConfig,
) {
this.logger = this.logger.scoped(['license']);
this.logger = this.logger.scoped('license');
}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/logging/logger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export class Logger {
}

/** Create a logger that injects the given scopes into its log metadata. */
scoped(scopes: LogScope[]) {
scoped(scopes: LogScope | LogScope[]) {
scopes = Array.isArray(scopes) ? scopes : [scopes];
const scopedLogger = new Logger(this.globalConfig, this.instanceSettings);
const childLogger = this.internalLogger.child({ scopes });

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/scaling/job-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class JobProcessor {
private readonly nodeTypes: NodeTypes,
private readonly instanceSettings: InstanceSettings,
) {
this.logger = this.logger.scoped(['scaling']);
this.logger = this.logger.scoped('scaling');
}

async processJob(job: Job): Promise<JobResult> {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/scaling/scaling.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ScalingService {
private readonly orchestrationService: OrchestrationService,
private readonly eventService: EventService,
) {
this.logger = this.logger.scoped(['scaling']);
this.logger = this.logger.scoped('scaling');
}

// #region Lifecycle
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/scaling/worker-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class WorkerServer {
) {
assert(this.instanceSettings.instanceType === 'worker');

this.logger = this.logger.scoped(['scaling']);
this.logger = this.logger.scoped('scaling');

this.app = express();

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/wait-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class WaitTracker {
private readonly orchestrationService: OrchestrationService,
private readonly instanceSettings: InstanceSettings,
) {
this.logger = this.logger.scoped(['waiting-executions']);
this.logger = this.logger.scoped('waiting-executions');
}

has(executionId: string) {
Expand Down

0 comments on commit ca2e143

Please sign in to comment.