mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
FEATURE: emit grid error when failed to recover or open grid
This commit is contained in:
parent
6ea49f98c2
commit
bc23055536
|
@ -2136,13 +2136,16 @@ func (s *Strategy) startProcess(ctx context.Context, session *bbgo.ExchangeSessi
|
|||
// do recover only when triggerPrice is not set and not in the back-test mode
|
||||
s.logger.Infof("recoverWhenStart is set, trying to recover grid orders...")
|
||||
if err := s.recoverGrid(ctx, session); err != nil {
|
||||
s.logger.WithError(err).Errorf("recover error")
|
||||
// if recover fail, return and do not open grid
|
||||
s.EmitGridError(errors.Wrapf(err, "failed to start process, recover error"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// avoid using goroutine here for back-test
|
||||
if err := s.openGrid(ctx, session); err != nil {
|
||||
s.logger.WithError(err).Errorf("failed to setup grid orders")
|
||||
s.EmitGridError(errors.Wrapf(err, "failed to start process, setup grid orders error"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user