Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
siiky committed Oct 1, 2024
1 parent e666643 commit 54ce796
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions lib/brain.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ Brain.prototype.traderRun = function traderRun () {
* TODO: Once the old poller is thrown away I believe we can change to a
* "native" GraphQL polling mechanism.
*/
this.pollHandle = setVariableInterval(() => {
if (this.state === 'networkDown') this.trader.clearConfigVersion()
return this.trader.poll()
},
ACTIVE_POLL_INTERVAL,
res => (res || this.networkDown) ? ACTIVE_POLL_INTERVAL : IDLE_POLL_INTERVAL
this.pollHandle = setVariableInterval(
() => this.state === 'networkDown' ?
this.trader.clearConfigVersion() :
this.trader.poll(),
ACTIVE_POLL_INTERVAL,
res => (res || this.networkDown) ? ACTIVE_POLL_INTERVAL : IDLE_POLL_INTERVAL
)

return this.trader.loadConfigsFromDB().then(_ => this.trader.poll())
Expand Down
2 changes: 1 addition & 1 deletion lib/lssettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ module.exports = (readwrite=false) => {
device_name, number_of_cassettes, number_of_recyclers,
paper_receipt, sms_receipt
FROM static_config
WHERE rowid = 1`,
WHERE rowid = 1`
)

/* Ping URLs */
Expand Down
3 changes: 2 additions & 1 deletion lib/trader.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ Trader.prototype.loadConfigsFromDB = function loadConfigsFromDB () {

return lssettings.loadConfig()
.then(config => {
if (config === null) return
if (config === null)
return console.log("No previous config saved in lssettings")
const {
coins,
locales,
Expand Down

0 comments on commit 54ce796

Please sign in to comment.