mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Remove last license runtime check (#15629)
This commit is contained in:
@@ -106,9 +106,6 @@ export class License implements LicenseProvider {
|
||||
|
||||
await this.manager.initialize();
|
||||
|
||||
const features = this.manager.getFeatures();
|
||||
this.checkIsLicensedForMultiMain(features);
|
||||
|
||||
this.logger.debug('License initialized');
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
@@ -142,8 +139,6 @@ export class License implements LicenseProvider {
|
||||
|
||||
this.logger.debug('License feature change detected', _features);
|
||||
|
||||
this.checkIsLicensedForMultiMain(_features);
|
||||
|
||||
if (isMultiMain && !isLeader) {
|
||||
this.logger
|
||||
.scoped(['scaling', 'multi-main-setup', 'license'])
|
||||
@@ -431,30 +426,6 @@ export class License implements LicenseProvider {
|
||||
return this.getUsersLimit() === UNLIMITED_LICENSE_QUOTA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the instance is licensed for multi-main setup if multi-main mode is enabled
|
||||
*/
|
||||
private checkIsLicensedForMultiMain(features: TFeatures) {
|
||||
const isMultiMainEnabled =
|
||||
config.getEnv('executions.mode') === 'queue' && this.globalConfig.multiMainSetup.enabled;
|
||||
if (!isMultiMainEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isMultiMainLicensed =
|
||||
(features[LICENSE_FEATURES.MULTIPLE_MAIN_INSTANCES] as boolean | undefined) ?? false;
|
||||
|
||||
this.instanceSettings.setMultiMainLicensed(isMultiMainLicensed);
|
||||
|
||||
if (!isMultiMainLicensed) {
|
||||
this.logger
|
||||
.scoped(['scaling', 'multi-main-setup', 'license'])
|
||||
.debug(
|
||||
'License changed with no support for multi-main setup - no new followers will be allowed to init. To restore multi-main setup, please upgrade to a license that supports this feature.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@OnLeaderTakeover()
|
||||
enableAutoRenewals() {
|
||||
this.manager?.enableAutoRenewals();
|
||||
|
||||
Reference in New Issue
Block a user