mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
refactor(core): Move instanceType to InstanceSettings (no-changelog) (#10640)
This commit is contained in:
committed by
GitHub
parent
50beefb658
commit
25c8a328a8
@@ -31,8 +31,6 @@ import type {
|
||||
export class ScalingService {
|
||||
private queue: JobQueue;
|
||||
|
||||
private readonly instanceType = config.getEnv('generic.instanceType');
|
||||
|
||||
constructor(
|
||||
private readonly logger: Logger,
|
||||
private readonly activeExecutions: ActiveExecutions,
|
||||
@@ -211,9 +209,10 @@ export class ScalingService {
|
||||
throw error;
|
||||
});
|
||||
|
||||
if (this.instanceType === 'main' || this.instanceType === 'webhook') {
|
||||
const { instanceType } = this.instanceSettings;
|
||||
if (instanceType === 'main' || instanceType === 'webhook') {
|
||||
this.registerMainOrWebhookListeners();
|
||||
} else if (this.instanceType === 'worker') {
|
||||
} else if (instanceType === 'worker') {
|
||||
this.registerWorkerListeners();
|
||||
}
|
||||
}
|
||||
@@ -295,7 +294,7 @@ export class ScalingService {
|
||||
}
|
||||
|
||||
private assertWorker() {
|
||||
if (this.instanceType === 'worker') return;
|
||||
if (this.instanceSettings.instanceType === 'worker') return;
|
||||
|
||||
throw new ApplicationError('This method must be called on a `worker` instance');
|
||||
}
|
||||
@@ -311,7 +310,7 @@ export class ScalingService {
|
||||
get isQueueMetricsEnabled() {
|
||||
return (
|
||||
this.globalConfig.endpoints.metrics.includeQueueMetrics &&
|
||||
this.instanceType === 'main' &&
|
||||
this.instanceSettings.instanceType === 'main' &&
|
||||
!this.orchestrationService.isMultiMainSetupEnabled
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user