Skip to content

Commit

Permalink
fix: poll on networkDown
Browse files Browse the repository at this point in the history
  • Loading branch information
siiky committed Nov 28, 2024
1 parent c8e5b82 commit de1bdac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/brain.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ Brain.prototype.traderRun = function traderRun () {
.then(_ => this.trader.poll())
.finally(() => {
this.pollHandle = setVariableInterval(
() => this.state === 'networkDown' ?
this.trader.clearConfigVersion() :
this.trader.poll() ,
() => {
if (this.state === 'networkDown') this.trader.clearConfigVersion()
return this.trader.poll()
},
ACTIVE_POLL_INTERVAL,
res => (res || this.networkDown) ? ACTIVE_POLL_INTERVAL : IDLE_POLL_INTERVAL
)
Expand Down

0 comments on commit de1bdac

Please sign in to comment.