mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-09 07:26:48 +00:00
exchanges/websocket: update websocket rate limiting to use requester rate limiting functionality (#1578)
* exchanges/websocket: update websocket rate limiting to use requester rate limiting functionality. * glorious: nits * rm unsused * updoo * glorious: purgerino * reduce duplicate code * thrasher: engrish --------- Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
This commit is contained in:
@@ -32,8 +32,6 @@ import (
|
||||
"github.com/thrasher-corp/gocryptotrader/portfolio/withdraw"
|
||||
)
|
||||
|
||||
const wsRateLimitMillisecond = 1000
|
||||
|
||||
var errNotEnoughPairs = errors.New("at least one currency is required to fetch order history")
|
||||
|
||||
// SetDefaults sets the basic defaults for Bithumb
|
||||
@@ -172,7 +170,7 @@ func (b *Bithumb) Setup(exch *config.Exchange) error {
|
||||
return b.Websocket.SetupNewConnection(stream.ConnectionSetup{
|
||||
ResponseCheckTimeout: exch.WebsocketResponseCheckTimeout,
|
||||
ResponseMaxLimit: exch.WebsocketResponseMaxLimit,
|
||||
RateLimit: wsRateLimitMillisecond,
|
||||
RateLimit: request.NewWeightedRateLimitByDuration(time.Second),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user