From 129b25d86e8daeec8e4762a6614f5aa44813f5ee Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 25 Mar 2021 13:18:38 +0800 Subject: [PATCH] fix persistence key --- pkg/strategy/xmaker/strategy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/strategy/xmaker/strategy.go b/pkg/strategy/xmaker/strategy.go index bef0cd921..2d944a52c 100644 --- a/pkg/strategy/xmaker/strategy.go +++ b/pkg/strategy/xmaker/strategy.go @@ -404,7 +404,7 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se var state State // load position - if err := s.Persistence.Load(&state, stateKey); err != nil { + if err := s.Persistence.Load(&state, ID, s.Symbol, stateKey); err != nil { if err != service.ErrPersistenceNotExists { return err } @@ -467,7 +467,7 @@ func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, se close(s.stopC) - if err := s.Persistence.Save(s.state, stateKey); err != nil { + if err := s.Persistence.Save(s.state, ID, s.Symbol, stateKey); err != nil { log.WithError(err).Errorf("can not save state: %+v", s.state) } else { log.Infof("state is saved => %+v", s.state)