Skip to content

Commit

Permalink
Merge pull request #1242 from siiky/fix/lam-1248/stuck-network-down
Browse files Browse the repository at this point in the history
LAM-1248 fix: poll on `networkDown`
  • Loading branch information
RafaelTaranto authored Nov 28, 2024
2 parents c8e5b82 + de1bdac commit ae0404b
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 ae0404b

Please sign in to comment.