mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
feat: add possibility to configure stop time for workers (#4012)
* feat: add a timer to gracefully control how long workers wait before exiting
This commit is contained in:
parent
aec5c26564
commit
a3791c22b3
|
@ -85,7 +85,7 @@ export class Worker extends Command {
|
||||||
const externalHooks = ExternalHooks();
|
const externalHooks = ExternalHooks();
|
||||||
await externalHooks.run('n8n.stop', []);
|
await externalHooks.run('n8n.stop', []);
|
||||||
|
|
||||||
const maxStopTime = 30000;
|
const maxStopTime = config.getEnv('queue.bull.gracefulShutdownTimeout') * 1000;
|
||||||
|
|
||||||
const stopTime = new Date().getTime() + maxStopTime;
|
const stopTime = new Date().getTime() + maxStopTime;
|
||||||
|
|
||||||
|
|
|
@ -351,6 +351,12 @@ export const schema = {
|
||||||
default: 60,
|
default: 60,
|
||||||
env: 'QUEUE_RECOVERY_INTERVAL',
|
env: 'QUEUE_RECOVERY_INTERVAL',
|
||||||
},
|
},
|
||||||
|
gracefulShutdownTimeout: {
|
||||||
|
doc: 'How long should n8n wait for running executions before exiting worker process',
|
||||||
|
format: Number,
|
||||||
|
default: 30,
|
||||||
|
env: 'QUEUE_WORKER_TIMEOUT',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue