go
This commit is contained in:
parent
fe51e85983
commit
b73f846b7f
|
@ -45,9 +45,9 @@ type SharedState struct {
|
||||||
nh *dragonboat.NodeHost
|
nh *dragonboat.NodeHost
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fsm *SharedState) GetUserState(Userid int64) (us *UserState, err error) {
|
func (ss *SharedState) GetUserState(Userid int64) (us *UserState, err error) {
|
||||||
|
|
||||||
ius, err := nh.SyncRead(context.TODO(), fsm.shardID, Userid)
|
ius, err := ss.nh.SyncRead(context.TODO(), ss.shardID, Userid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -62,9 +62,9 @@ func (fsm *SharedState) GetUserState(Userid int64) (us *UserState, err error) {
|
||||||
Key: Userid,
|
Key: Userid,
|
||||||
}
|
}
|
||||||
|
|
||||||
cs := nh.GetNoOPSession(128)
|
cs := ss.nh.GetNoOPSession(128)
|
||||||
err = cmd.Encode(func(buf []byte) error {
|
err = cmd.Encode(func(buf []byte) error {
|
||||||
result, err := nh.SyncPropose(context.TODO(), cs, buf)
|
result, err := ss.nh.SyncPropose(context.TODO(), cs, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user