mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 23:16:53 +00:00
New features and bug fixes
- Modifications made to the request package. Planned improvements will be sending requests on intervals, rate limiter back off support, dynamic tuning and requests packaged into a request job group. - Can modify each exchanges individual HTTP client (e.g timeout and transport settings). - Bot now uses an exchange config HTTP timeout value. - Bot now uses a global HTTP timeout (configurable). - Batched ticker request support for exchanges. - Ticker and Orderbook fetching now are spanned accross multiple go routines and regulated by a sync wait group. - Fixes hack used to load exchanges, now uses a sync wait group. - Ticker and Orderbook storage and fetching now uses mutex locks. - New pair function for finding different pairs between two supplied pair arrays. This is used for currency pair updates for exchange which support dynamic updating. - Shows removal/additions of dynamic updates currencies.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -44,7 +43,6 @@ const (
|
||||
type Yobit struct {
|
||||
exchange.Base
|
||||
Ticker map[string]Ticker
|
||||
*request.Handler
|
||||
}
|
||||
|
||||
// SetDefaults sets current default value for Yobit
|
||||
@@ -65,8 +63,8 @@ func (y *Yobit) SetDefaults() {
|
||||
y.ConfigCurrencyPairFormat.Uppercase = true
|
||||
y.AssetTypes = []string{ticker.Spot}
|
||||
y.SupportsAutoPairUpdating = false
|
||||
y.Handler = new(request.Handler)
|
||||
y.SetRequestHandler(y.Name, yobitAuthRate, yobitUnauthRate, new(http.Client))
|
||||
y.SupportsRESTTickerBatching = true
|
||||
y.Requester = request.New(y.Name, request.NewRateLimit(time.Second, yobitAuthRate), request.NewRateLimit(time.Second, yobitUnauthRate), common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
|
||||
}
|
||||
|
||||
// Setup sets exchange configuration parameters for Yobit
|
||||
@@ -83,6 +81,7 @@ func (y *Yobit) Setup(exch config.ExchangeConfig) {
|
||||
y.BaseCurrencies = common.SplitStrings(exch.BaseCurrencies, ",")
|
||||
y.AvailablePairs = common.SplitStrings(exch.AvailablePairs, ",")
|
||||
y.EnabledPairs = common.SplitStrings(exch.EnabledPairs, ",")
|
||||
y.SetHTTPClientTimeout(exch.HTTPTimeout)
|
||||
err := y.SetCurrencyPairFormat()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -3,6 +3,7 @@ package yobit
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/common"
|
||||
"github.com/thrasher-/gocryptotrader/currency/pair"
|
||||
@@ -12,8 +13,12 @@ import (
|
||||
)
|
||||
|
||||
// Start starts the WEX go routine
|
||||
func (y *Yobit) Start() {
|
||||
go y.Run()
|
||||
func (y *Yobit) Start(wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
y.Run()
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
|
||||
// Run implements the Yobit wrapper
|
||||
|
||||
Reference in New Issue
Block a user