Skip to content

Commit

Permalink
fix(core): Fix new graceful shutdown env being always overridden by d…
Browse files Browse the repository at this point in the history
…eprecated env (#8503)
  • Loading branch information
ivov authored and netroy committed Feb 2, 2024
1 parent f7bc5d7 commit 31e4cd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/BaseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export abstract class BaseCommand extends Command {
/**
* How long to wait for graceful shutdown before force killing the process.
*/
protected gracefulShutdownTimeoutInS: number = config.getEnv('generic.gracefulShutdownTimeout');
protected gracefulShutdownTimeoutInS = config.getEnv('generic.gracefulShutdownTimeout');

async init(): Promise<void> {
await initErrorHandling();
Expand Down
7 changes: 4 additions & 3 deletions packages/cli/src/commands/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,10 @@ export class Worker extends BaseCommand {
}

async init() {
const configuredShutdownTimeout = config.getEnv('queue.bull.gracefulShutdownTimeout');
if (configuredShutdownTimeout) {
this.gracefulShutdownTimeoutInS = configuredShutdownTimeout;
const { QUEUE_WORKER_TIMEOUT } = process.env;
if (QUEUE_WORKER_TIMEOUT) {
this.gracefulShutdownTimeoutInS =
parseInt(QUEUE_WORKER_TIMEOUT, 10) || config.default('queue.bull.gracefulShutdownTimeout');
this.logger.warn(
'QUEUE_WORKER_TIMEOUT has been deprecated. Rename it to N8N_GRACEFUL_SHUTDOWN_TIMEOUT.',
);
Expand Down

0 comments on commit 31e4cd8

Please sign in to comment.