From 6de25d1c6da14fc19b131f902f7c5c612b7d24a4 Mon Sep 17 00:00:00 2001 From: duanhf2012 <6549168@qq.com> Date: Tue, 9 May 2023 14:34:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96rankservice=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node/node.go | 6 +++--- sysservice/rankservice/RankSkip.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/node/node.go b/node/node.go index e347d4c..ebb1e36 100644 --- a/node/node.go +++ b/node/node.go @@ -295,9 +295,9 @@ func GetService(serviceName string) service.IService { return service.GetService(serviceName) } -func SetConfigDir(configDir string) { - configDir = configDir - cluster.SetConfigDir(configDir) +func SetConfigDir(cfgDir string) { + configDir = cfgDir + cluster.SetConfigDir(cfgDir) } func GetConfigDir() string { diff --git a/sysservice/rankservice/RankSkip.go b/sysservice/rankservice/RankSkip.go index a0c7609..e2a7dc1 100644 --- a/sysservice/rankservice/RankSkip.go +++ b/sysservice/rankservice/RankSkip.go @@ -356,12 +356,12 @@ func (rs *RankSkip) GetRankNodeDataByRank(rank uint64) (*RankData, uint64) { // GetRankKeyPrevToLimit 获取key前count名的数据 func (rs *RankSkip) GetRankKeyPrevToLimit(findKey, count uint64, result *rpc.RankDataList) error { if rs.GetRankLen() <= 0 { - return fmt.Errorf("rank[", rs.rankId, "] no data") + return fmt.Errorf("rank[%d] no data", rs.rankId) } findData, ok := rs.mapRankData[findKey] if ok == false { - return fmt.Errorf("rank[", rs.rankId, "] no data") + return fmt.Errorf("rank[%d] no data", rs.rankId) } _, rankPos := rs.skipList.GetWithPosition(findData) @@ -385,12 +385,12 @@ func (rs *RankSkip) GetRankKeyPrevToLimit(findKey, count uint64, result *rpc.Ran // GetRankKeyPrevToLimit 获取key前count名的数据 func (rs *RankSkip) GetRankKeyNextToLimit(findKey, count uint64, result *rpc.RankDataList) error { if rs.GetRankLen() <= 0 { - return fmt.Errorf("rank[", rs.rankId, "] no data") + return fmt.Errorf("rank[%d] no data", rs.rankId) } findData, ok := rs.mapRankData[findKey] if ok == false { - return fmt.Errorf("rank[", rs.rankId, "] no data") + return fmt.Errorf("rank[%d] no data", rs.rankId) } _, rankPos := rs.skipList.GetWithPosition(findData)