This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 716705c18 patch: update sort-func in generating condition-ruleV3.1 
(#2688)
716705c18 is described below

commit 716705c180e1707da15290ef31781bca3ef18afa
Author: YarBor <[email protected]>
AuthorDate: Sat Jun 15 21:31:54 2024 +0800

    patch: update sort-func in generating condition-ruleV3.1 (#2688)
    
    Signed-off-by: YarBor <[email protected]>
    Co-authored-by: YarBor <[email protected]>
---
 cluster/router/condition/dynamic_router.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cluster/router/condition/dynamic_router.go 
b/cluster/router/condition/dynamic_router.go
index 6603d9bad..b952127cc 100644
--- a/cluster/router/condition/dynamic_router.go
+++ b/cluster/router/condition/dynamic_router.go
@@ -213,6 +213,9 @@ func generateMultiConditionRoute(rawConfig string) 
(multiplyConditionRoute, bool
        }
 
        sort.Slice(conditionRouters, func(i, j int) bool {
+               if conditionRouters[i].trafficDisable {
+                       return true
+               }
                return conditionRouters[i].priority > 
conditionRouters[j].priority
        })
        return conditionRouters, force, enable, nil

Reply via email to