remove general rate limiter from batch query since it's already handled in the exchange

This commit is contained in:
c9s 2022-06-02 16:42:18 +08:00
parent a878f35ca1
commit 02a8bf4c8c
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54
2 changed files with 1 additions and 5 deletions

View File

@ -5,8 +5,6 @@ import (
"strconv"
"time"
"golang.org/x/time/rate"
"github.com/c9s/bbgo/pkg/types"
)
@ -16,8 +14,7 @@ type ClosedOrderBatchQuery struct {
func (q *ClosedOrderBatchQuery) Query(ctx context.Context, symbol string, startTime, endTime time.Time, lastOrderID uint64) (c chan types.Order, errC chan error) {
query := &AsyncTimeRangedBatchQuery{
Type: types.Order{},
Limiter: rate.NewLimiter(rate.Every(5*time.Second), 2),
Type: types.Order{},
Q: func(startTime, endTime time.Time) (interface{}, error) {
orders, err := q.ExchangeTradeHistoryService.QueryClosedOrders(ctx, symbol, startTime, endTime, lastOrderID)
return orders, err

View File

@ -24,7 +24,6 @@ func (e TradeBatchQuery) Query(ctx context.Context, symbol string, options *type
endTime := *options.EndTime
query := &AsyncTimeRangedBatchQuery{
Type: types.Trade{},
Limiter: rate.NewLimiter(rate.Every(5*time.Second), 2),
Q: func(startTime, endTime time.Time) (interface{}, error) {
return e.ExchangeTradeHistoryService.QueryTrades(ctx, symbol, options)
},