mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(core): Enforce shutdown timer and sequence on SIGINT
for main (#10346)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
This commit is contained in:
parent
b044e783e7
commit
5255793afe
|
@ -315,7 +315,7 @@ export abstract class BaseCommand extends Command {
|
||||||
this.exit(exitCode);
|
this.exit(exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private onTerminationSignal(signal: string) {
|
protected onTerminationSignal(signal: string) {
|
||||||
return async () => {
|
return async () => {
|
||||||
if (this.shutdownService.isShuttingDown()) {
|
if (this.shutdownService.isShuttingDown()) {
|
||||||
this.logger.info(`Received ${signal}. Already shutting down...`);
|
this.logger.info(`Received ${signal}. Already shutting down...`);
|
||||||
|
|
|
@ -332,7 +332,7 @@ export class Start extends BaseCommand {
|
||||||
this.openBrowser();
|
this.openBrowser();
|
||||||
} else if (key.charCodeAt(0) === 3) {
|
} else if (key.charCodeAt(0) === 3) {
|
||||||
// Ctrl + c got pressed
|
// Ctrl + c got pressed
|
||||||
void this.stopProcess();
|
void this.onTerminationSignal('SIGINT')();
|
||||||
} else {
|
} else {
|
||||||
// When anything else got pressed, record it and send it on enter into the child process
|
// When anything else got pressed, record it and send it on enter into the child process
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue