From b73f846b7fe3a313b120fb9a51297e727cdbeb81 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 2 Aug 2023 19:08:44 +0800 Subject: [PATCH] go --- fsm/fsm.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }