aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-12-30 14:51:06 -0800
committerAdam Soltys <[email protected]>2019-02-05 20:53:45 -0800
commit06333923b3e29c45b6c76e57a3baaad24041c931 (patch)
tree392c3b6dee324078707f875efd5007e721f29ed3
parent2da89011ca8dd0158fc2258b27c05ae1a93bf73a (diff)
downloadcoinos-server-06333923b3e29c45b6c76e57a3baaad24041c931.tar.gz
coinos-server-06333923b3e29c45b6c76e57a3baaad24041c931.zip
faster polling
-rw-r--r--index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.js b/index.js
index 5cdbb866..d723e2f5 100644
--- a/index.js
+++ b/index.js
@@ -473,11 +473,13 @@ const l = console.log
try {
let res = await axios.get('https://api.quadrigacx.com/v2/order_book')
let ask = res.data.asks[0][0]
- l('quadriga ask price: ', ask)
+ let now = new Date()
+ let ts = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}`
+ l(ts, 'quadriga ask price:', ask)
app.set('rates', { ask })
} catch (e) { l(e) }
- setTimeout(fetchRates, 150000)
+ setTimeout(fetchRates, 30000)
})()
app.get('/rates', (req, res) => {