-
-
Notifications
You must be signed in to change notification settings - Fork 111
Add exit_on_error option for Server::run_server_on_rt
#578
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
Conversation
entire process exits if the server fails to start
joseluisq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, just a small update to make and fix formatting.
exit_on_error optionexit_on_error option for Server::run_server_on_rt
Co-authored-by: Jose Quintana <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are formatting issues. Fix them by applying cargo fmt.
joseluisq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
add
exit_on_erroroption when starting server to choose if the entire process exits if the server fails to startDescription
Added
exit_on_erroras an additional argument torun_server_on_rt. When set totruethis exits the entire process if the server fails to start (the current behavior). When set to false the error is propagated to the caller ofrun_server_on_rt.run_standaloneandrun_as_servicedon't expose this parameter, passingtrueto keep the current behavior.Related Issue
Motivation and Context
I'm using
static-web-serveras a library and found it killed my entire program when it failed to start, but I need a more graceful exit (clean up, etc).How Has This Been Tested?
I ran
cargo testand all tests passed. This was on Linux.Screenshots (if appropriate):