mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
fix persistence key
This commit is contained in:
parent
89c01adf60
commit
129b25d86e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user