mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
refactor(core): Separate license state from license service (#15097)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'reflect-metadata';
|
||||
import { LicenseState } from '@n8n/backend-common';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
import { LICENSE_FEATURES } from '@n8n/constants';
|
||||
import { Container } from '@n8n/di';
|
||||
@@ -197,7 +198,7 @@ export abstract class BaseCommand extends Command {
|
||||
);
|
||||
}
|
||||
|
||||
const isLicensed = Container.get(License).isFeatureEnabled(LICENSE_FEATURES.BINARY_DATA_S3);
|
||||
const isLicensed = Container.get(License).isLicensed(LICENSE_FEATURES.BINARY_DATA_S3);
|
||||
if (!isLicensed) {
|
||||
this.logger.error(
|
||||
'No license found for S3 storage. \n Either set `N8N_DEFAULT_BINARY_DATA_MODE` to something else, or upgrade to a license that supports this feature.',
|
||||
@@ -241,6 +242,8 @@ export abstract class BaseCommand extends Command {
|
||||
this.license = Container.get(License);
|
||||
await this.license.init();
|
||||
|
||||
Container.get(LicenseState).setLicenseProvider(this.license);
|
||||
|
||||
const { activationKey } = this.globalConfig.license;
|
||||
|
||||
if (activationKey) {
|
||||
|
||||
Reference in New Issue
Block a user