mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
优化rankservice错误返回
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user