migrate to go mod
This commit is contained in:
1 parent
665641c88b
commit
72e6bbe6d7
45 files changed
+784
-1029
No files matched your search
+6
-5
@@ -2,7 +2,7 @@ package server
|
||||
|
||||
import (
|
||||
"github.com/integration-system/go-cmp/cmp"
|
||||
"github.com/integration-system/isp-lib/config"
|
||||
"github.com/integration-system/isp-lib/v2/config"
|
||||
log "github.com/integration-system/isp-log"
|
||||
"github.com/valyala/fasthttp"
|
||||
"isp-gate-service/conf"
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const defaultTimeout = 60 * time.Second
|
||||
|
||||
var Http = &httpSrv{mx: sync.Mutex{}}
|
||||
|
||||
type httpSrv struct {
|
||||
@@ -30,7 +32,7 @@ func (s *httpSrv) Init(new, old conf.HttpSetting) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *httpSrv) run(MaxRequestBodySize int64) {
|
||||
func (s *httpSrv) run(maxRequestBodySize int64) {
|
||||
s.mx.Lock()
|
||||
s.working = true
|
||||
if s.srv != nil {
|
||||
@@ -38,13 +40,12 @@ func (s *httpSrv) run(MaxRequestBodySize int64) {
|
||||
log.Warn(log_code.WarnHttpServerShutdown, err)
|
||||
}
|
||||
}
|
||||
maxRequestBodySize := MaxRequestBodySize
|
||||
localConfig := config.Get().(*conf.Configuration)
|
||||
restAddress := localConfig.HttpInnerAddress.GetAddress()
|
||||
s.srv = &fasthttp.Server{
|
||||
Handler: handler.CompleteRequest,
|
||||
WriteTimeout: time.Second * 60,
|
||||
ReadTimeout: time.Second * 60,
|
||||
WriteTimeout: defaultTimeout,
|
||||
ReadTimeout: defaultTimeout,
|
||||
MaxRequestBodySize: int(maxRequestBodySize),
|
||||
}
|
||||
go func() {
|
||||
|
||||
Reference in new issue
Block a user