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

diff --git a/main.go b/main.go
index a72a832f64121ea375d790129d8c6a44ddf7d41d..04089476af5f7c254cded79f1d18a01d16b9489b 100644 (file)
--- a/main.go
+++ b/main.go
@@ -187,7 +187,7 @@ func applyConfig(ctx context.Context, configS *Config, routeP *pweb.WebPath, log
                        } else {
                                e = httpDealer(ctx1, w, r, path, backArray[backI], logger)
                        }
-                       if e != nil {
+                       if e != nil && backArray[backI].IsLive() {
                                logger.L(`W:`, fmt.Sprintf("%s=>%s 后端失效", path, backArray[backI].Name))
                                backArray[backI].Disable()
                        }
@@ -344,11 +344,13 @@ func wsDealer(ctx context.Context, w http.ResponseWriter, r *http.Request, route
                        }()
                        select {
                        case e := <-fin:
-                               logger.L(`E:`, fmt.Sprintf("%s=>%s %v", routePath, back.Name, e))
-                               return ErrCopy
+                               if e != nil {
+                                       logger.L(`E:`, fmt.Sprintf("%s=>%s %v", routePath, back.Name, e))
+                                       return ErrCopy
+                               }
                        case <-ctx.Done():
-                               return nil
                        }
+                       return nil
                }
        }
 }