mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 04:10:01 +00:00
refactor(core): Move instanceType to InstanceSettings (no-changelog) (#10640)
This commit is contained in:
committed by
GitHub
parent
50beefb658
commit
25c8a328a8
@@ -16,6 +16,8 @@ type Settings = ReadOnlySettings & WritableSettings;
|
||||
|
||||
type InstanceRole = 'unset' | 'leader' | 'follower';
|
||||
|
||||
export type InstanceType = 'main' | 'webhook' | 'worker';
|
||||
|
||||
const inTest = process.env.NODE_ENV === 'test';
|
||||
|
||||
@Service()
|
||||
@@ -40,6 +42,15 @@ export class InstanceSettings {
|
||||
|
||||
readonly instanceId = this.generateInstanceId();
|
||||
|
||||
readonly instanceType: InstanceType;
|
||||
|
||||
constructor() {
|
||||
const command = process.argv[2];
|
||||
this.instanceType = ['webhook', 'worker'].includes(command)
|
||||
? (command as InstanceType)
|
||||
: 'main';
|
||||
}
|
||||
|
||||
/**
|
||||
* A main is:
|
||||
* - `unset` during bootup,
|
||||
|
||||
@@ -10,7 +10,7 @@ export * from './Constants';
|
||||
export * from './Credentials';
|
||||
export * from './DirectoryLoader';
|
||||
export * from './Interfaces';
|
||||
export { InstanceSettings } from './InstanceSettings';
|
||||
export { InstanceSettings, InstanceType } from './InstanceSettings';
|
||||
export * from './NodeExecuteFunctions';
|
||||
export * from './WorkflowExecute';
|
||||
export { NodeExecuteFunctions };
|
||||
|
||||
Reference in New Issue
Block a user