diff --git a/packages/cli/src/license.ts b/packages/cli/src/license.ts index ee8bfd0fae..21ef6c577f 100644 --- a/packages/cli/src/license.ts +++ b/packages/cli/src/license.ts @@ -109,6 +109,7 @@ export class License { }); await this.manager.initialize(); + this.logger.debug('License initialized'); } catch (e: unknown) { if (e instanceof Error) { this.logger.error('Could not initialize license manager sdk', e); @@ -132,6 +133,8 @@ export class License { } async onFeatureChange(_features: TFeatures): Promise { + this.logger.debug('License feature change detected', _features); + if (config.getEnv('executions.mode') === 'queue' && config.getEnv('multiMainSetup.enabled')) { const isMultiMainLicensed = _features[LICENSE_FEATURES.MULTIPLE_MAIN_INSTANCES] as | boolean @@ -198,14 +201,15 @@ export class License { } await this.manager.activate(activationKey); + this.logger.debug('License activated'); } async reload(): Promise { if (!this.manager) { return; } - this.logger.debug('Reloading license'); await this.manager.reload(); + this.logger.debug('License reloaded'); } async renew() { @@ -214,6 +218,7 @@ export class License { } await this.manager.renew(); + this.logger.debug('License renewed'); } @OnShutdown() @@ -227,6 +232,7 @@ export class License { } await this.manager.shutdown(); + this.logger.debug('License shut down'); } isFeatureEnabled(feature: BooleanLicenseFeature) { @@ -392,5 +398,6 @@ export class License { async reinit() { this.manager?.reset(); await this.init('main', true); + this.logger.debug('License reinitialized'); } } diff --git a/packages/cli/src/services/__tests__/orchestration.service.test.ts b/packages/cli/src/services/__tests__/orchestration.service.test.ts index 3aec2a607e..5cb10c6598 100644 --- a/packages/cli/src/services/__tests__/orchestration.service.test.ts +++ b/packages/cli/src/services/__tests__/orchestration.service.test.ts @@ -14,7 +14,6 @@ import { handleCommandMessageMain } from '@/services/orchestration/main/handle-c import { OrchestrationHandlerMainService } from '@/services/orchestration/main/orchestration.handler.main.service'; import * as helpers from '@/services/orchestration/helpers'; import { ExternalSecretsManager } from '@/external-secrets/external-secrets-manager.ee'; -import { Logger } from '@/logger'; import { Push } from '@/push'; import { ActiveWorkflowManager } from '@/active-workflow-manager'; import { mockInstance } from '@test/mocking'; @@ -47,7 +46,6 @@ const workerRestartEventBusResponse: RedisServiceWorkerResponseObject = { }; describe('Orchestration Service', () => { - const logger = mockInstance(Logger); mockInstance(Push); mockInstance(RedisService); mockInstance(ExternalSecretsManager); @@ -112,7 +110,6 @@ describe('Orchestration Service', () => { expect(responseFalseId).toBeDefined(); expect(responseFalseId!.command).toEqual('reloadLicense'); expect(responseFalseId!.senderId).toEqual('test'); - expect(logger.error).toHaveBeenCalled(); }); test('should reject command messages from itself', async () => { diff --git a/packages/cli/src/services/orchestration/main/handle-command-message-main.ts b/packages/cli/src/services/orchestration/main/handle-command-message-main.ts index 9ea171b062..18930aa0c8 100644 --- a/packages/cli/src/services/orchestration/main/handle-command-message-main.ts +++ b/packages/cli/src/services/orchestration/main/handle-command-message-main.ts @@ -53,11 +53,7 @@ export async function handleCommandMessageMain(messageString: string) { } if (isMainInstance && !config.getEnv('multiMainSetup.enabled')) { - // at this point in time, only a single main instance is supported, thus this command _should_ never be caught currently - logger.error( - 'Received command to reload license via Redis, but this should not have happened and is not supported on the main instance yet.', - ); - return message; + return message; // this main is the sender, so disregard } await Container.get(License).reload(); break;