From 05a484ec56db9bb4c5b8dbbd0d4579149cdadb5c Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Mon, 16 May 2022 02:49:44 +0800 Subject: [PATCH] fix: strategyStickySessions nil pointer --- adapter/outboundgroup/loadbalance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adapter/outboundgroup/loadbalance.go b/adapter/outboundgroup/loadbalance.go index 93542c9d..393a6f31 100644 --- a/adapter/outboundgroup/loadbalance.go +++ b/adapter/outboundgroup/loadbalance.go @@ -147,7 +147,7 @@ func strategyStickySessions() strategyFn { } Sessions := make(map[string]map[string]Session) go func() { - for true { + for { time.Sleep(time.Second * 60) now := time.Now().Unix() for _, subMap := range Sessions { @@ -174,7 +174,7 @@ func strategyStickySessions() strategyFn { session.time = now var i int - var res C.Proxy + var res = proxies[0] for i := 0; i < length; i++ { idx := (session.idx + i) % length proxy := proxies[idx]