From 9fa647ed65d9964ee608be11c6b2ae2d04464af8 Mon Sep 17 00:00:00 2001 From: chiahung Date: Thu, 6 Apr 2023 16:12:19 +0800 Subject: [PATCH] rename method --- pkg/strategy/grid2/recover.go | 6 +++--- pkg/strategy/grid2/strategy.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/strategy/grid2/recover.go b/pkg/strategy/grid2/recover.go index c50a9fc57..85ed5a91f 100644 --- a/pkg/strategy/grid2/recover.go +++ b/pkg/strategy/grid2/recover.go @@ -12,7 +12,7 @@ import ( "github.com/pkg/errors" ) -func (s *Strategy) recoverGridByScanningTrades(ctx context.Context, session *bbgo.ExchangeSession) error { +func (s *Strategy) recoverByScanningTrades(ctx context.Context, session *bbgo.ExchangeSession) error { historyService, implemented := session.Exchange.(types.ExchangeTradeHistoryService) // if the exchange doesn't support ExchangeTradeHistoryService, do not run recover if !implemented { @@ -64,14 +64,14 @@ func (s *Strategy) recoverGridByScanningTrades(ctx context.Context, session *bbg } s.logger.Infof("start to recover") - if err := s.recoverGridWithOpenOrdersByScanningTrades(ctx, historyService, openOrdersOnGrid); err != nil { + if err := s.recoverWithOpenOrdersByScanningTrades(ctx, historyService, openOrdersOnGrid); err != nil { return errors.Wrap(err, "grid recover error") } return nil } -func (s *Strategy) recoverGridWithOpenOrdersByScanningTrades(ctx context.Context, historyService types.ExchangeTradeHistoryService, openOrdersOnGrid []types.Order) error { +func (s *Strategy) recoverWithOpenOrdersByScanningTrades(ctx context.Context, historyService types.ExchangeTradeHistoryService, openOrdersOnGrid []types.Order) error { if s.orderQueryService == nil { return fmt.Errorf("orderQueryService is nil, it can't get orders by trade") } diff --git a/pkg/strategy/grid2/strategy.go b/pkg/strategy/grid2/strategy.go index e6a8d4fc9..89ab8aaa0 100644 --- a/pkg/strategy/grid2/strategy.go +++ b/pkg/strategy/grid2/strategy.go @@ -1942,14 +1942,14 @@ func (s *Strategy) startProcess(ctx context.Context, session *bbgo.ExchangeSessi func (s *Strategy) recoverGrid(ctx context.Context, session *bbgo.ExchangeSession) error { if s.RecoverGridByScanningTrades { s.debugLog("recover grid by scanning trades") - return s.recoverGridByScanningTrades(ctx, session) + return s.recoverByScanningTrades(ctx, session) } s.debugLog("recover grid by scanning orders") - return s.recoverGridByScanningOrders(ctx, session) + return s.recoverByScanningOrders(ctx, session) } -func (s *Strategy) recoverGridByScanningOrders(ctx context.Context, session *bbgo.ExchangeSession) error { +func (s *Strategy) recoverByScanningOrders(ctx context.Context, session *bbgo.ExchangeSession) error { openOrders, err := queryOpenOrdersUntilSuccessful(ctx, session.Exchange, s.Symbol) if err != nil { return err