mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Add hooks (#1053)
* ⚡ add 2 hooks * ⚡ Fix issue that if hook errors n8n would not shut down Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -70,6 +70,13 @@ export class Start extends Command {
|
||||
static async stopProcess() {
|
||||
console.log(`\nStopping n8n...`);
|
||||
|
||||
const externalHooks = ExternalHooks();
|
||||
try {
|
||||
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
|
||||
// kill after max. 30 seconds no matter what
|
||||
|
||||
Reference in New Issue
Block a user