mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-01-12 00:06:29 +08:00
feat: add backend api timeout
This commit is contained in:
@@ -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"
|
||||
@@ -56,8 +57,12 @@ func Start() {
|
||||
global.CONF.Conn.BindAddress = fmt.Sprintf("[%s]", global.CONF.Conn.BindAddress)
|
||||
}
|
||||
server := &http.Server{
|
||||
Addr: global.CONF.Conn.BindAddress + ":" + global.CONF.Conn.Port,
|
||||
Handler: rootRouter,
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user