From 54ce79636e5b7eadced946c464e2ad9086046720 Mon Sep 17 00:00:00 2001 From: siiky Date: Tue, 1 Oct 2024 16:40:30 +0200 Subject: [PATCH] chore: formatting --- lib/brain.js | 12 ++++++------ lib/lssettings.js | 2 +- lib/trader.js | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/brain.js b/lib/brain.js index ad0e61c7c..6481fe889 100644 --- a/lib/brain.js +++ b/lib/brain.js @@ -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()) diff --git a/lib/lssettings.js b/lib/lssettings.js index 18072048f..36c61d574 100644 --- a/lib/lssettings.js +++ b/lib/lssettings.js @@ -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 */ diff --git a/lib/trader.js b/lib/trader.js index 6aed66a83..72b45d945 100644 --- a/lib/trader.js +++ b/lib/trader.js @@ -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,