aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/app.coffee5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/app.coffee b/src/app.coffee
index 86d6bd03..dec4205a 100644
--- a/src/app.coffee
+++ b/src/app.coffee
@@ -41,7 +41,7 @@ cache = (req, res, next) ->
res.setHeader "Cache-Control", "public, max-age=900"
next()
-setInterval(->
+fetchRates = ->
file = 'public/js/rates.json'
fs.truncate(file, 0, ->
stream = fs.createWriteStream(file)
@@ -51,7 +51,8 @@ setInterval(->
stream.write(chunk)
)
)
-, 120000)
+
+ setTimeout(fetchRates, 120000)
app.get('/', cache, sessions.new)
app.get('/register', cache, users.new)