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

@@ -42,9 +42,8 @@ export abstract class BaseCommand extends Command {
/**
* How long to wait for graceful shutdown before force killing the process.
* Subclasses can override this value.
*/
protected gracefulShutdownTimeoutInS: number = 30;
protected gracefulShutdownTimeoutInS: number = config.getEnv('generic.gracefulShutdownTimeout');
async init(): Promise<void> {
await initErrorHandling();