mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-28 19:41:27 +00:00
Apply FallbackTag to leastping and roundrobin
This commit is contained in:
parent
5c41292836
commit
69e1734e3a
|
@ -128,12 +128,14 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||||
return &Balancer{
|
return &Balancer{
|
||||||
selectors: br.OutboundSelector,
|
selectors: br.OutboundSelector,
|
||||||
strategy: &LeastPingStrategy{},
|
strategy: &LeastPingStrategy{},
|
||||||
|
fallbackTag: br.FallbackTag,
|
||||||
ohm: ohm,
|
ohm: ohm,
|
||||||
}, nil
|
}, nil
|
||||||
case "roundrobin":
|
case "roundrobin":
|
||||||
return &Balancer{
|
return &Balancer{
|
||||||
selectors: br.OutboundSelector,
|
selectors: br.OutboundSelector,
|
||||||
strategy: &RoundRobinStrategy{},
|
strategy: &RoundRobinStrategy{},
|
||||||
|
fallbackTag: br.FallbackTag,
|
||||||
ohm: ohm,
|
ohm: ohm,
|
||||||
}, nil
|
}, nil
|
||||||
case "leastload":
|
case "leastload":
|
||||||
|
@ -148,7 +150,8 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||||
leastLoadStrategy := NewLeastLoadStrategy(s)
|
leastLoadStrategy := NewLeastLoadStrategy(s)
|
||||||
return &Balancer{
|
return &Balancer{
|
||||||
selectors: br.OutboundSelector,
|
selectors: br.OutboundSelector,
|
||||||
ohm: ohm, fallbackTag: br.FallbackTag,
|
ohm: ohm,
|
||||||
|
fallbackTag: br.FallbackTag,
|
||||||
strategy: leastLoadStrategy,
|
strategy: leastLoadStrategy,
|
||||||
}, nil
|
}, nil
|
||||||
case "random":
|
case "random":
|
||||||
|
@ -156,7 +159,8 @@ func (br *BalancingRule) Build(ohm outbound.Manager, dispatcher routing.Dispatch
|
||||||
case "":
|
case "":
|
||||||
return &Balancer{
|
return &Balancer{
|
||||||
selectors: br.OutboundSelector,
|
selectors: br.OutboundSelector,
|
||||||
ohm: ohm, fallbackTag: br.FallbackTag,
|
ohm: ohm,
|
||||||
|
fallbackTag: br.FallbackTag,
|
||||||
strategy: &RandomStrategy{},
|
strategy: &RandomStrategy{},
|
||||||
}, nil
|
}, nil
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue