mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-19 22:09:03 +08:00
feat: add backend api timeout
This commit is contained in:
parent
b772effacd
commit
5d674f14ad
1 changed files with 7 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"time"
|
||||
|
||||
"github.com/1Panel-dev/1Panel/core/init/db"
|
||||
"github.com/1Panel-dev/1Panel/core/init/geo"
|
||||
|
|
@ -58,6 +59,10 @@ func Start() {
|
|||
server := &http.Server{
|
||||
Addr: global.CONF.Conn.BindAddress + ":" + global.CONF.Conn.Port,
|
||||
Handler: rootRouter,
|
||||
ReadHeaderTimeout: 5 * time.Second,
|
||||
ReadTimeout: 600 * time.Second,
|
||||
WriteTimeout: 600 * time.Second,
|
||||
IdleTimeout: 240 * time.Second,
|
||||
}
|
||||
ln, err := net.Listen(tcpItem, server.Addr)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue