From: qydysky Date: Sun, 3 Dec 2023 03:51:28 +0000 (+0800) Subject: 1 X-Git-Tag: v0.1.20231203035145 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=f9d8fb3b1fad982827d46c8c1d05aeba6718a5f6;p=front%2F.git 1 --- diff --git a/main.go b/main.go index f91f572..8acc6dd 100644 --- a/main.go +++ b/main.go @@ -327,15 +327,13 @@ func wsDealer(ctx context.Context, w http.ResponseWriter, r *http.Request, route logger.L(`E:`, fmt.Sprintf("%s=>%s %v", routePath, back.Name, e)) return ErrResDoFail } else { + ctx, cancle := pctx.WithWait(ctx, 2, time.Second*45) + defer func() { + _ = cancle() + }() fin := make(chan error) reqc := req.NetConn() resc := res.NetConn() - ctx, cancle := pctx.WithWait(ctx, 2, time.Second*30) - defer func() { - if errors.Is(cancle(), pctx.ErrWaitTo) { - logger.L(`E:`, "退出超时") - } - }() go func() { ctx1, done1 := pctx.WaitCtx(ctx) defer done1()