|
|
@ -4,10 +4,6 @@ import ( |
|
|
|
"fmt" |
|
|
|
"gin-vue-admin/global" |
|
|
|
"gin-vue-admin/initialize" |
|
|
|
"github.com/fvbock/endless" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
"net/http" |
|
|
|
"runtime" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
@ -15,23 +11,6 @@ type server interface { |
|
|
|
ListenAndServe() error |
|
|
|
} |
|
|
|
|
|
|
|
func initServer(address string, router *gin.Engine) server { |
|
|
|
if runtime.GOOS == "windows" { |
|
|
|
return &http.Server{ |
|
|
|
Addr: address, |
|
|
|
Handler: router, |
|
|
|
ReadTimeout: 10 * time.Second, |
|
|
|
WriteTimeout: 10 * time.Second, |
|
|
|
MaxHeaderBytes: 1 << 20, |
|
|
|
} |
|
|
|
} |
|
|
|
s := endless.NewServer(address, router) |
|
|
|
s.ReadHeaderTimeout = 10 * time.Millisecond |
|
|
|
s.WriteTimeout = 10 * time.Second |
|
|
|
s.MaxHeaderBytes = 1 << 20 |
|
|
|
return s |
|
|
|
} |
|
|
|
|
|
|
|
func RunWindowsServer() { |
|
|
|
if global.GVA_CONFIG.System.UseMultipoint { |
|
|
|
// 初始化redis服务
|
|
|
|