From 06333923b3e29c45b6c76e57a3baaad24041c931 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 30 Dec 2018 14:51:06 -0800 Subject: faster polling --- index.js | 6 ++++-- 1 file 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) => { -- cgit v1.2.3