mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: emit grid ready only when there is no error
This commit is contained in:
parent
55476e4176
commit
56628aca73
|
@ -891,14 +891,14 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
|
||||||
|
|
||||||
s.debugGridOrders(submitOrders, lastPrice)
|
s.debugGridOrders(submitOrders, lastPrice)
|
||||||
|
|
||||||
// try to always emit grid ready
|
|
||||||
defer s.EmitGridReady()
|
|
||||||
|
|
||||||
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
|
createdOrders, err2 := s.orderExecutor.SubmitOrders(ctx, submitOrders...)
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// try to always emit grid ready
|
||||||
|
defer s.EmitGridReady()
|
||||||
|
|
||||||
// update the number of orders to metrics
|
// update the number of orders to metrics
|
||||||
baseLabels := s.newPrometheusLabels()
|
baseLabels := s.newPrometheusLabels()
|
||||||
metricsGridNumOfOrders.With(baseLabels).Set(float64(len(createdOrders)))
|
metricsGridNumOfOrders.With(baseLabels).Set(float64(len(createdOrders)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user