Skip to content

Commit

Permalink
修改代码
Browse files Browse the repository at this point in the history
  • Loading branch information
pangdogs committed Apr 21, 2024
1 parent caa4826 commit 18ebd99
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions service_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ func (instance *ServiceInstance) GetRPC() rpc.IRPC {
return rpc.Using(instance)
}

// GetStartupIdx 获取启动索引
func (instance *ServiceInstance) GetStartupIdx() int {
v, _ := instance.GetMemKVs().Load("startup.idx")
if v == nil {
panic("service memory startup.idx not existed")
}
return v.(int)
}

// GetStartupConf 获取启动参数配置
func (instance *ServiceInstance) GetStartupConf() *viper.Viper {
v, _ := instance.GetMemKVs().Load("startup.conf")
Expand Down

0 comments on commit 18ebd99

Please sign in to comment.