-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Move health endpoint-related code into a separate file #344
Conversation
This is a first step towards #342. At this point HealthHandler merely encapsulates static methods. The idea is to have init() method also handle moving Settings::General::health to RequestHandlerOpts::health in future. Ideally, handling of the health setting CLI and config file will be added here as well (not trivial given how parsing is tied to data structures).
Review changes with SemanticDiff. Analyzed 4 of 4 files. Overall, the semantic diff is 17% smaller than the GitHub diff.
|
…eded in future either
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.
Just minor changes but looks fine to me overall.
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!
This is largely analogous to #344, another step towards fixing #342. Loading logger module in lib.rs was moved up for sake of consistency: modules loaded after it will have macros like server_info imported implicitly, the ones loaded before won't. Further alphabetical rearranging of modules was performed by rustftm.
Description
This creates a new module
health
responsible for the health endpoint. So far it handles the server initialization in theinit()
method and request processing in thepre_process()
method. Ideally, handling of the health setting in CLI and config file will also be added here in future (not trivial given how parsing is tied to data structures).Related Issue
This is a tiny first step towards #342.
How Has This Been Tested?
Tests pass, and I’ve added a few new tests as well. I did not perform any functional testing at this point.