fix(core): Fix shutdown if terminating before hooks are initialized (#8047)

If the app receives termination signal before hooks have been
initialised, the would be objet is undefined error. This PR fixes that.
This commit is contained in:
Tomi Turtiainen
2023-12-18 09:23:10 +02:00
committed by GitHub
parent 2689c37e87
commit 6ae2f5efea
4 changed files with 5 additions and 5 deletions

View File

@@ -101,7 +101,7 @@ export class Start extends BaseCommand {
// Stop with trying to activate workflows that could not be activated
this.activeWorkflowRunner.removeAllQueuedWorkflowActivations();
await this.externalHooks.run('n8n.stop', []);
await this.externalHooks?.run('n8n.stop', []);
setTimeout(async () => {
// In case that something goes wrong with shutdown we