-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(server): include callback for when the server is ready + fix bugs #50
Conversation
closes [PLT-134]
pkg/common/server/server.go
Outdated
|
||
c := make(chan os.Signal, 3) | ||
signal.Notify(c, os.Interrupt, syscall.SIGTERM) | ||
<-c | ||
|
||
s.logger.Infof("Shutdown Server ...") | ||
|
||
if err := s.httpServer.Shutdown(ctx); err != nil { | ||
s.logger.Fatal("Server forced to shutdown: ", err) | ||
} | ||
|
||
s.logger.Infof("Server exiting") |
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, that's a dead code because s.httpServer.ListenAndServe()
blocks the execution.
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.
Is this the best way to know that the server is ready?
that's it or create requests to check if it's ready... |
Maybe a GET operation on /readyz endpoint is better to know if the server is initialized. What do you think? |
closes PLT-134