refactor(core): Remove last license runtime check (#15629)

This commit is contained in:
Iván Ovejero
2025-05-23 14:35:52 +02:00
committed by GitHub
parent f762c59fb3
commit 7f98e5d534

View File

@@ -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();