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

This commit is contained in:
Iván Ovejero 2024-08-12 11:41:21 +02:00 committed by GitHub
parent b044e783e7
commit 5255793afe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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...`);

View file

@ -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