mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Make sure that n8n stops even if there are unforeseen errors
This commit is contained in:
parent
28074d94a4
commit
df020136d3
|
@ -70,12 +70,9 @@ export class Start extends Command {
|
|||
static async stopProcess() {
|
||||
console.log(`\nStopping n8n...`);
|
||||
|
||||
const externalHooks = ExternalHooks();
|
||||
try {
|
||||
const externalHooks = ExternalHooks();
|
||||
await externalHooks.run('n8n.stop', []);
|
||||
} catch (error) {
|
||||
console.error('There was an error in the "n8n.stop" hook.', error);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
// In case that something goes wrong with shutdown we
|
||||
|
@ -109,6 +106,10 @@ export class Start extends Command {
|
|||
executingWorkflows = activeExecutionsInstance.getActiveExecutions();
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('There was an error shutting down n8n.', error);
|
||||
}
|
||||
|
||||
process.exit(processExistCode);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue