mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-17 12:58:51 +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"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/core/init/db"
|
"github.com/1Panel-dev/1Panel/core/init/db"
|
||||||
"github.com/1Panel-dev/1Panel/core/init/geo"
|
"github.com/1Panel-dev/1Panel/core/init/geo"
|
||||||
|
|
@ -58,6 +59,10 @@ func Start() {
|
||||||
server := &http.Server{
|
server := &http.Server{
|
||||||
Addr: global.CONF.Conn.BindAddress + ":" + global.CONF.Conn.Port,
|
Addr: global.CONF.Conn.BindAddress + ":" + global.CONF.Conn.Port,
|
||||||
Handler: rootRouter,
|
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)
|
ln, err := net.Listen(tcpItem, server.Addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue