Skip to content

Commit

Permalink
Start expanding test coverage for exchange.go and fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thrasher- committed Sep 30, 2019
1 parent e2d5754 commit 6951b4c
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 41 deletions.
6 changes: 3 additions & 3 deletions engine/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ func (e *ExchangeCurrencyPairSyncer) update(exchangeName string, p currency.Pair
e.CurrencyPairs[x].Ticker.HaveData = true
e.CurrencyPairs[x].Ticker.IsProcessing = false
if atomic.LoadInt32(&e.initSyncCompleted) != 1 && !origHadData {
removedCounter++
log.Debugf(log.SyncMgr, "%s ticker sync complete %v [%d/%d].\n",
exchangeName, FormatCurrency(p).String(), removedCounter, createdCounter)
removedCounter++
e.initSyncWG.Done()
}

Expand All @@ -243,9 +243,9 @@ func (e *ExchangeCurrencyPairSyncer) update(exchangeName string, p currency.Pair
e.CurrencyPairs[x].Orderbook.HaveData = true
e.CurrencyPairs[x].Orderbook.IsProcessing = false
if atomic.LoadInt32(&e.initSyncCompleted) != 1 && !origHadData {
removedCounter++
log.Debugf(log.SyncMgr, "%s orderbook sync complete %v [%d/%d].\n",
exchangeName, FormatCurrency(p).String(), removedCounter, createdCounter)
removedCounter++
e.initSyncWG.Done()
}

Expand All @@ -258,9 +258,9 @@ func (e *ExchangeCurrencyPairSyncer) update(exchangeName string, p currency.Pair
e.CurrencyPairs[x].Trade.HaveData = true
e.CurrencyPairs[x].Trade.IsProcessing = false
if atomic.LoadInt32(&e.initSyncCompleted) != 1 && !origHadData {
removedCounter++
log.Debugf(log.SyncMgr, "%s trade sync complete %v [%d/%d].\n",
exchangeName, FormatCurrency(p).String(), removedCounter, createdCounter)
removedCounter++
e.initSyncWG.Done()
}
}
Expand Down
8 changes: 5 additions & 3 deletions engine/timekeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func (n *ntpManager) Start() (err error) {
}
}()

if Bot.Config.NTPClient.Level == -1 {
err = errors.New("NTP client disabled")
return
}

log.Debugln(log.TimeMgr, "NTP manager starting...")
if Bot.Config.NTPClient.Level == 0 && *Bot.Config.Logging.Enabled {
// Initial NTP check (prompts user on how we should proceed)
Expand Down Expand Up @@ -101,9 +106,6 @@ func (n *ntpManager) run() {
return
case <-t.C:
n.processTime()
if Bot.Config.NTPClient.Level == 0 {
close(n.shutdown)
}
}
}
}
Expand Down
Loading

0 comments on commit 6951b4c

Please sign in to comment.