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
support LifeCycleCallback #4918
Conversation
DeepSource test cases can not pass. Pls take a look! |
why we need this feature? can you provide some scenarios? |
@@ -76,6 +77,12 @@ func NewHttpServerWithCfg(cfg *Config) *HttpServer { | |||
// MiddleWare function for http.Handler | |||
type MiddleWare func(http.Handler) http.Handler | |||
|
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.
Why there is no any implement of LifeCycleCallback ?
lgtm |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
这个合并,导致我无法开启graceful模式,开启后执行到ServeWithListener时,就不继续向下执行了..请问大家居然都没有遇到类似问题吗? |
有最小可复现的例子吗?我来看看。 |
|
Go's
net.http.Server
cannot process in-transit requests when the server is shuting down, so graceful is set to the default Server implementation.net.http.Server
is used only if the user manually turn off (graceful=false
).GetAllControllerInfo
.GetAllControllerInfo
can be used to debug and manage routing information conveniently in debugging and other extension mechanisms.LifeCycleCallback
. Adding 'AfterStart' and 'BeforeShutdown' extension points in the Beego framework lifecycle to provide more extensibility.graceful=false
),才使用net.http.Server
。GetAllControllerInfo
)。在调试或者其他扩展机制中,路由信息内省可以很方便的调试、管理路由信息。比如在应用启动时,列出所有的route信息,有助于业务开发者查看路由是否生效。
AfterStart
和BeforeShutdown
扩展点,能够提供更多的扩展性。比如在应用就绪后,将应用注册到consul等注册中心。