From 9a2ab9b6a3331de03d1ca0cd15c9a77d2b9f4c58 Mon Sep 17 00:00:00 2001 From: hossinasaadi Date: Sun, 7 Jan 2024 20:07:39 +0400 Subject: [PATCH] fix roundRobin --- app/router/balancing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/router/balancing.go b/app/router/balancing.go index ad0a3b36..e6f29a67 100644 --- a/app/router/balancing.go +++ b/app/router/balancing.go @@ -2,6 +2,7 @@ package router import ( "context" + reflect "reflect" sync "sync" "github.com/xtls/xray-core/common/dice" @@ -49,7 +50,7 @@ func (s *RoundRobinStrategy) PickOutbound(tags []string) string { if len(tags) == 0 { panic("0 tags") } - if s.roundRobin == nil { + if s.roundRobin == nil || !reflect.DeepEqual(s.roundRobin.tags, tags) { s.roundRobin = NewRoundRobin(tags) } tag := s.roundRobin.NextTag()