From ca3f1ebae6b71c2224987f1cf7828cf1338d5509 Mon Sep 17 00:00:00 2001 From: xishang0128 Date: Sat, 12 Oct 2024 08:26:37 +0800 Subject: [PATCH] fix: sticky-sessions may not be effective --- adapter/outboundgroup/loadbalance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapter/outboundgroup/loadbalance.go b/adapter/outboundgroup/loadbalance.go index 738ed154..048cc34c 100644 --- a/adapter/outboundgroup/loadbalance.go +++ b/adapter/outboundgroup/loadbalance.go @@ -204,7 +204,7 @@ func strategyStickySessions(url string) strategyFn { for i := 1; i < maxRetry; i++ { proxy := proxies[nowIdx] if proxy.AliveForTestUrl(url) { - if nowIdx != idx { + if !has || nowIdx != idx { lruCache.Set(key, nowIdx) }