running the websocket if enabled

This commit is contained in:
Ermal Guni
2018-08-05 15:15:34 +02:00
parent 0f26026a15
commit 6fc05d46d2

View File

@@ -2,12 +2,12 @@ package okex
import (
"errors"
exchange "gocryptotrader/exchanges"
"log"
"sync"
"github.com/thrasher-/gocryptotrader/common"
"github.com/thrasher-/gocryptotrader/currency/pair"
"github.com/thrasher-/gocryptotrader/exchanges"
"github.com/thrasher-/gocryptotrader/exchanges/orderbook"
"github.com/thrasher-/gocryptotrader/exchanges/ticker"
)
@@ -28,6 +28,10 @@ func (o *OKEX) Run() {
log.Printf("%s polling delay: %ds.\n", o.GetName(), o.RESTPollingDelay)
log.Printf("%s %d currencies enabled: %s.\n", o.GetName(), len(o.EnabledPairs), o.EnabledPairs)
}
if o.Websocket {
go o.WebsocketClient()
}
}
// UpdateTicker updates and returns the ticker for a currency pair