modify timeout settings

This commit is contained in:
zhuyasen
2024-04-12 00:32:46 +08:00
parent 8b93cf3045
commit 448017cb30
28 changed files with 122 additions and 147 deletions

View File

@@ -3,7 +3,6 @@ package initial
import (
"fmt"
"strconv"
"time"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger"
@@ -25,8 +24,6 @@ func CreateServices() []app.IServer {
httpAddr := ":" + strconv.Itoa(cfg.HTTP.Port)
httpRegistry, httpInstance := registerService("http", cfg.App.Host, cfg.HTTP.Port)
httpServer := server.NewHTTPServer_pbExample(httpAddr,
server.WithHTTPReadTimeout(time.Second*time.Duration(cfg.HTTP.ReadTimeout)),
server.WithHTTPWriteTimeout(time.Second*time.Duration(cfg.HTTP.WriteTimeout)),
server.WithHTTPRegistry(httpRegistry, httpInstance),
server.WithHTTPIsProd(cfg.App.Env == "prod"),
)