From eaf70909197ed511efe9add956eb5e4f78b27e20 Mon Sep 17 00:00:00 2001 From: Cornelius Suermann Date: Mon, 24 Apr 2023 11:46:04 +0200 Subject: [PATCH] fix(core): Skip license activation when instance was already activated (#6064) --- packages/cli/src/commands/start.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/cli/src/commands/start.ts b/packages/cli/src/commands/start.ts index 359c79d58..358d8091e 100644 --- a/packages/cli/src/commands/start.ts +++ b/packages/cli/src/commands/start.ts @@ -189,8 +189,16 @@ export class Start extends BaseCommand { await license.init(this.instanceId); const activationKey = config.getEnv('license.activationKey'); + if (activationKey) { + const hasCert = (await license.loadCertStr()).length > 0; + + if (hasCert) { + return LoggerProxy.debug('Skipping license activation'); + } + try { + LoggerProxy.debug('Attempting license activation'); await license.activate(activationKey); } catch (e) { LoggerProxy.error('Could not activate license', e as Error);