mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
feat(core): Add support for floating licenses (#7090)
This PR updates the license-sdk to v2.5.0 which introduces optional support for floating licenses.
This commit is contained in:
parent
fd78021b68
commit
e26553f198
|
@ -102,7 +102,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@n8n/client-oauth2": "workspace:*",
|
||||
"@n8n_io/license-sdk": "~2.4.0",
|
||||
"@n8n_io/license-sdk": "~2.5.1",
|
||||
"@oclif/command": "^1.8.16",
|
||||
"@oclif/core": "^1.16.4",
|
||||
"@oclif/errors": "^1.3.6",
|
||||
|
|
|
@ -104,6 +104,14 @@ export class License {
|
|||
await this.manager.renew();
|
||||
}
|
||||
|
||||
async shutdown() {
|
||||
if (!this.manager) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.manager.shutdown();
|
||||
}
|
||||
|
||||
isFeatureEnabled(feature: BooleanLicenseFeature) {
|
||||
return this.manager?.hasFeatureEnabled(feature) ?? false;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ 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');
|
||||
|
@ -98,6 +99,10 @@ export class Start extends BaseCommand {
|
|||
await this.exitSuccessFully();
|
||||
}, 30000);
|
||||
|
||||
// Shut down License manager to unclaim any floating entitlements
|
||||
// Note: While this saves a new license cert to DB, the previous entitlements are still kept in memory so that the shutdown process can complete
|
||||
await Container.get(License).shutdown();
|
||||
|
||||
await Container.get(InternalHooks).onN8nStop();
|
||||
|
||||
const skipWebhookDeregistration = config.getEnv(
|
||||
|
@ -133,7 +138,7 @@ export class Start extends BaseCommand {
|
|||
executingWorkflows = activeExecutionsInstance.getActiveExecutions();
|
||||
}
|
||||
|
||||
//finally shut down Event Bus
|
||||
// Finally shut down Event Bus
|
||||
await eventBus.close();
|
||||
} catch (error) {
|
||||
await this.exitWithCrash('There was an error shutting down n8n.', error);
|
||||
|
|
|
@ -198,8 +198,8 @@ importers:
|
|||
specifier: workspace:*
|
||||
version: link:../@n8n/client-oauth2
|
||||
'@n8n_io/license-sdk':
|
||||
specifier: ~2.4.0
|
||||
version: 2.4.0
|
||||
specifier: ~2.5.1
|
||||
version: 2.5.1
|
||||
'@oclif/command':
|
||||
specifier: ^1.8.16
|
||||
version: 1.8.18(@oclif/config@1.18.5)(supports-color@8.1.1)
|
||||
|
@ -4653,8 +4653,8 @@ packages:
|
|||
acorn-walk: 8.2.0
|
||||
dev: false
|
||||
|
||||
/@n8n_io/license-sdk@2.4.0:
|
||||
resolution: {integrity: sha512-99kuCVH4NcBi4nyn/WIpd6KSIMLk/pbBks0zr8bC65ALKj0se7/2MwC6N+WwGkG7NqH0kMdGe/7Y5KnJkMTefg==}
|
||||
/@n8n_io/license-sdk@2.5.1:
|
||||
resolution: {integrity: sha512-CL4JVJS8nvI8qPFQ1jSG7CiPnNkeKJSgbDxWOLVX4MRjTKrwL8Cpd1LeYMx5g5StmHzkoxz2TDqL8WT6qyMlrQ==}
|
||||
engines: {node: '>=14.0.0', npm: '>=7.10.0'}
|
||||
dependencies:
|
||||
crypto-js: 4.1.1
|
||||
|
|
Loading…
Reference in a new issue