xfunding: fix syncSpotPosition cancel order issue

This commit is contained in:
c9s 2023-06-16 17:35:24 +08:00
parent 2813ede7ed
commit 34d42afbec
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -826,7 +826,7 @@ func (s *Strategy) syncSpotPosition(ctx context.Context) {
return
}
log.Infof("spot/futures positions: %s (spot) <=> %s (futures)", spotBase.String(), futuresBase.String())
log.Infof("syncSpotPosition: spot/futures positions: %s (spot) <=> %s (futures)", spotBase.String(), futuresBase.String())
if futuresBase.Sign() > 0 {
// unexpected error
@ -834,7 +834,7 @@ func (s *Strategy) syncSpotPosition(ctx context.Context) {
return
}
_ = s.futuresOrderExecutor.GracefulCancel(ctx)
_ = s.spotOrderExecutor.GracefulCancel(ctx)
ticker, err := s.spotSession.Exchange.QueryTicker(ctx, s.Symbol)
if err != nil {