Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vapor intercepts SIGINT (and others) without a way to disable that #3041

Open
weissi opened this issue Jul 21, 2023 · 1 comment
Open

Vapor intercepts SIGINT (and others) without a way to disable that #3041

weissi opened this issue Jul 21, 2023 · 1 comment

Comments

@weissi
Copy link
Contributor

weissi commented Jul 21, 2023

makeSignalSource(SIGINT)

In certain cases I would like SIGINT to just terminate my program so it'd be good if I could tell Vapor not to intercept some signals.

@samisuteria
Copy link
Contributor

You can use this extension to clear all the commands Vapor adds (serve, boot, and routes) and add your own default command with application.commands.use(MyCommand(), as: "serve", isDefault: true)

extension Commands {
    mutating func reset() {
        defaultCommand = nil
        commands = [:]
    }
}

Warning: you do need to have some command for when the server runs otherwise it won't start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants