feat(core): Add N8N_GRACEFUL_SHUTDOWN_TIMEOUT env var (#8068)

Add generic N8N_GRACEFUL_SHUTDOWN_TIMEOUT which controls how long n8n
process will wait for graceful exit before exitting forcefully. This
variables replaces the QUEUE_WORKER_TIMEOUT variable that was used for
worker process.

DEPRECATED: QUEUE_WORKER_TIMEOUT deprected

QUEUE_WORKER_TIMEOUT environment variable has been replaced with
N8N_GRACEFUL_SHUTDOWN_TIMEOUT.
This commit is contained in:
Tomi Turtiainen
2023-12-18 14:04:19 +02:00
committed by GitHub
parent 0590ac7826
commit 614f488386
3 changed files with 16 additions and 4 deletions

View File

@@ -264,7 +264,13 @@ export class Worker extends BaseCommand {
}
async init() {
this.gracefulShutdownTimeoutInS = config.getEnv('queue.bull.gracefulShutdownTimeout');
const configuredShutdownTimeout = config.getEnv('queue.bull.gracefulShutdownTimeout');
if (configuredShutdownTimeout) {
this.gracefulShutdownTimeoutInS = configuredShutdownTimeout;
this.logger.warn(
'QUEUE_WORKER_TIMEOUT has been deprecated. Rename it to N8N_GRACEFUL_SHUTDOWN_TIMEOUT.',
);
}
await this.initCrashJournal();
this.logger.debug('Starting n8n worker...');