浏览代码

fix roundRobin

hossinasaadi 1 年之前
父节点
当前提交
9a2ab9b6a3
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/router/balancing.go

+ 2 - 1
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()