mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
kucoin: fix kucoin rate limit
This commit is contained in:
parent
d742aea633
commit
b611a42bd9
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
var marketDataLimiter = rate.NewLimiter(rate.Every(1*time.Second), 1)
|
||||
var marketDataLimiter = rate.NewLimiter(rate.Every(5*time.Second), 1)
|
||||
var queryTradeLimiter = rate.NewLimiter(rate.Every(5*time.Second), 1)
|
||||
var queryOrderLimiter = rate.NewLimiter(rate.Every(5*time.Second), 1)
|
||||
|
||||
|
@ -160,7 +160,9 @@ func (e *Exchange) IsSupportedInterval(interval types.Interval) bool {
|
|||
}
|
||||
|
||||
func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval types.Interval, options types.KLineQueryOptions) ([]types.KLine, error) {
|
||||
_ = marketDataLimiter.Wait(ctx)
|
||||
if err := marketDataLimiter.Wait(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req := e.client.MarketDataService.NewGetKLinesRequest()
|
||||
req.Symbol(toLocalSymbol(symbol))
|
||||
|
|
Loading…
Reference in New Issue
Block a user