mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Unify application components shutdown (#8097)
## Summary Add `ShutdownService` and `OnShutdown` decorator for more unified way to shutdown different components. Use this new way in the following components: - HTTP(S) server - Pruning service - Push connection - License --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -63,7 +63,7 @@ export class Start extends BaseCommand {
|
||||
|
||||
protected activeWorkflowRunner: ActiveWorkflowRunner;
|
||||
|
||||
protected server = new Server();
|
||||
protected server = Container.get(Server);
|
||||
|
||||
private pruningService: PruningService;
|
||||
|
||||
@@ -101,14 +101,6 @@ export class Start extends BaseCommand {
|
||||
|
||||
await this.externalHooks?.run('n8n.stop', []);
|
||||
|
||||
// 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();
|
||||
|
||||
if (this.pruningService.isPruningEnabled()) {
|
||||
this.pruningService.stopPruning();
|
||||
}
|
||||
|
||||
if (Container.get(MultiMainSetup).isEnabled) {
|
||||
await this.activeWorkflowRunner.removeAllTriggerAndPollerBasedWorkflows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user