fix: Initialize license in queue mode correctly (#6301)

This commit is contained in:
Omar Ajoue
2023-05-23 13:01:50 +02:00
committed by GitHub
parent 55b755cb44
commit 42c79cd6f1
5 changed files with 26 additions and 23 deletions

View File

@@ -28,7 +28,6 @@ import { EDITOR_UI_DIST_DIR, GENERATED_STATIC_DIR } from '@/constants';
import { eventBus } from '@/eventbus';
import { BaseCommand } from './BaseCommand';
import { InternalHooks } from '@/InternalHooks';
import { License } from '@/License';
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
const open = require('open');
@@ -186,28 +185,6 @@ export class Start extends BaseCommand {
await Promise.all(files.map(compileFile));
}
async initLicense(): Promise<void> {
const license = Container.get(License);
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);
}
}
}
async init() {
await this.initCrashJournal();