From 7c292d0f0e5212fadf8d254dc519c6ffd11db52f Mon Sep 17 00:00:00 2001 From: qydysky Date: Sun, 3 Dec 2023 11:31:03 +0800 Subject: [PATCH] 1 --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 6598f98..f91f572 100644 --- a/main.go +++ b/main.go @@ -76,7 +76,7 @@ func Run(ctx context.Context, configSP *Config, logger *plog.Log_interface) { routeP := pweb.WebPath{} logger.L(`I:`, "启动...") - defer logger.L(`I:`, "退出...") + defer logger.L(`I:`, "退出,等待1min连接关闭...") // config对象初次加载 if e := applyConfig(ctx, configSP, &routeP, logger); e != nil { @@ -330,7 +330,7 @@ func wsDealer(ctx context.Context, w http.ResponseWriter, r *http.Request, route fin := make(chan error) reqc := req.NetConn() resc := res.NetConn() - ctx, cancle := pctx.WithWait(ctx, 2, time.Minute) + ctx, cancle := pctx.WithWait(ctx, 2, time.Second*30) defer func() { if errors.Is(cancle(), pctx.ErrWaitTo) { logger.L(`E:`, "退出超时") -- 2.39.2