]> 127.0.0.1 Git - front/.git/commitdiff
1 v0.1.20231203035145
authorqydysky <qydysky@foxmail.com>
Sun, 3 Dec 2023 03:51:28 +0000 (11:51 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 3 Dec 2023 03:51:28 +0000 (11:51 +0800)
main.go

diff --git a/main.go b/main.go
index f91f572c2ab9cd60c9d582e225c9191a01142051..8acc6dd2161239150ac033098632540cf538d1d4 100644 (file)
--- 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()