]> 127.0.0.1 Git - front/.git/commitdiff
1 v0.1.20240106031559
authorqydysky <qydysky@foxmail.com>
Sat, 6 Jan 2024 03:15:41 +0000 (11:15 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 6 Jan 2024 03:15:41 +0000 (11:15 +0800)
main.go

diff --git a/main.go b/main.go
index 57c56e57c86bee673c95e28571597cfd51b28c1f..d8d3aa6a3c768ba7adc8c9fa6da00dc048cd7890 100644 (file)
--- a/main.go
+++ b/main.go
@@ -271,7 +271,7 @@ func httpDealer(ctx context.Context, w http.ResponseWriter, r *http.Request, rou
        )
 
        for 0 < len(backs) && resp == nil {
-               chosenBack = backs[0]
+               chosenBack = backs[nanotime1()%int64(len(backs))]
                backs = backs[1:]
 
                url := chosenBack.To
@@ -364,7 +364,7 @@ func wsDealer(ctx context.Context, w http.ResponseWriter, r *http.Request, route
        )
 
        for 0 < len(backs) && resp == nil {
-               chosenBack = backs[0]
+               chosenBack = backs[nanotime1()%int64(len(backs))]
                backs = backs[1:]
 
                url := chosenBack.To