fix(core): Skip license activation when instance was already activated (#6064)

This commit is contained in:
Cornelius Suermann
2023-04-24 11:46:04 +02:00
committed by GitHub
parent 1eeadc6114
commit eaf7090919

View File

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