Minor improvements

1) gen_otp supports single use OTP secrets
2) improve database config check logic
3) reconnect websocket routine to engine (apart from the exchange pair syncer)
4) ImPrOvE CoNsIsTeNcY wItH LoG OuTpUt
This commit is contained in:
Adrian Gallagher
2019-08-26 12:46:53 +10:00
parent c1f9e04015
commit f6afeee800
5 changed files with 66 additions and 16 deletions

View File

@@ -295,11 +295,21 @@ func WebsocketRoutine() {
common.IsEnabled(Bot.Exchanges[i].IsWebsocketEnabled()))
}
// TO-DO: expose IsConnected() and IsConnecting so this can be simplified
if Bot.Exchanges[i].IsWebsocketEnabled() {
ws, err := Bot.Exchanges[i].GetWebsocket()
if err != nil {
log.Errorf(log.WebsocketMgr, "Exchange %s GetWebsocket error: %s\n",
Bot.Exchanges[i].GetName(), err)
return
}
// Exchange sync manager might have already started ws
// service or is in the process of connecting, so check
if ws.IsConnected() || ws.IsConnecting() {
return
}
// Data handler routine
go WebsocketDataHandler(ws)