diff --git a/fsm/fsm.go b/fsm/fsm.go index e203d53c..b2697264 100644 --- a/fsm/fsm.go +++ b/fsm/fsm.go @@ -45,9 +45,9 @@ type SharedState struct { 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 { log.Println(err) return nil, err @@ -62,9 +62,9 @@ func (fsm *SharedState) GetUserState(Userid int64) (us *UserState, err error) { Key: Userid, } - cs := nh.GetNoOPSession(128) + cs := ss.nh.GetNoOPSession(128) 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 { return err }