mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 22:51:29 +00:00
Fixes #3995 Use handlers with middleware when starting Graceful server
This commit is contained in:
parent
8f3d1c5f42
commit
075db4773b
4
app.go
4
app.go
@ -123,7 +123,7 @@ func (app *App) Run(mws ...MiddleWare) {
|
|||||||
httpsAddr = fmt.Sprintf("%s:%d", BConfig.Listen.HTTPSAddr, BConfig.Listen.HTTPSPort)
|
httpsAddr = fmt.Sprintf("%s:%d", BConfig.Listen.HTTPSAddr, BConfig.Listen.HTTPSPort)
|
||||||
app.Server.Addr = httpsAddr
|
app.Server.Addr = httpsAddr
|
||||||
}
|
}
|
||||||
server := grace.NewServer(httpsAddr, app.Handlers)
|
server := grace.NewServer(httpsAddr, app.Server.Handler)
|
||||||
server.Server.ReadTimeout = app.Server.ReadTimeout
|
server.Server.ReadTimeout = app.Server.ReadTimeout
|
||||||
server.Server.WriteTimeout = app.Server.WriteTimeout
|
server.Server.WriteTimeout = app.Server.WriteTimeout
|
||||||
if BConfig.Listen.EnableMutualHTTPS {
|
if BConfig.Listen.EnableMutualHTTPS {
|
||||||
@ -152,7 +152,7 @@ func (app *App) Run(mws ...MiddleWare) {
|
|||||||
}
|
}
|
||||||
if BConfig.Listen.EnableHTTP {
|
if BConfig.Listen.EnableHTTP {
|
||||||
go func() {
|
go func() {
|
||||||
server := grace.NewServer(addr, app.Handlers)
|
server := grace.NewServer(addr, app.Server.Handler)
|
||||||
server.Server.ReadTimeout = app.Server.ReadTimeout
|
server.Server.ReadTimeout = app.Server.ReadTimeout
|
||||||
server.Server.WriteTimeout = app.Server.WriteTimeout
|
server.Server.WriteTimeout = app.Server.WriteTimeout
|
||||||
if BConfig.Listen.ListenTCP4 {
|
if BConfig.Listen.ListenTCP4 {
|
||||||
|
Loading…
Reference in New Issue
Block a user