mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
remove general rate limiter from batch query since it's already handled in the exchange
This commit is contained in:
parent
a878f35ca1
commit
02a8bf4c8c
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user