From f87421d6e70253257ab932f322c5dd7bd1099d88 Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo Date: Sat, 11 Jul 2015 15:49:04 -0700 Subject: [PATCH 1/2] fix: now webapp s3 cache is correctly reset every 6h --- cli/lib/webapp.js | 17 +++++++++-------- cli/rtail-server.js | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cli/lib/webapp.js b/cli/lib/webapp.js index c0e96c9..3f779c8 100644 --- a/cli/lib/webapp.js +++ b/cli/lib/webapp.js @@ -12,9 +12,17 @@ const get = require('request').defaults({ encoding: null }) // serve frontend from s3 module.exports = function webapp(opts) { let cache = Object.create(null) - let cacheTTL = opts.cacheTTL + let cacheTTL = opts.ttl let s3 = opts.s3 + /*! + * wipes out cache every cacheTTL ms + */ + setInterval(function () { + cache = Object.create(null) + debug('cleared cache') + }, cacheTTL) + /*! * middleware */ @@ -35,13 +43,6 @@ module.exports = function webapp(opts) { }) } - /*! - * wipes out cache every cachettl ms - */ - setInterval(function () { - cache = Object.create(null) - }, cacheTTL) - /*! * serves req from cache */ diff --git a/cli/rtail-server.js b/cli/rtail-server.js index eea31fd..29a7c30 100755 --- a/cli/rtail-server.js +++ b/cli/rtail-server.js @@ -127,7 +127,7 @@ if (!argv.webVersion) { } else { app.use(webapp({ s3: 'http://rtail.s3-website-us-east-1.amazonaws.com/' + argv.webVersion, - ttl: 6000 * 60 * 60 + ttl: 1000 * 60 * 60 * 6 // 6H })) debug('serving webapp from: http://rtail.s3-website-us-east-1.amazonaws.com/%s', argv.webVersion) From e0d731dc3de9ab8ad2a597554a4a512d786c2feb Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo Date: Sat, 11 Jul 2015 15:50:44 -0700 Subject: [PATCH 2/2] bumped version to v0.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b189fd3..1ec8d4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rtail", - "version": "0.2.0", + "version": "0.2.1", "description": "Terminal output to the browser in seconds, using UNIX pipes.", "keywords": [ "tail",