From 1fff0bd89e8a4b9eb4e826c7245eaadbdf6141fa Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 11 Mar 2020 12:53:14 +0000 Subject: [PATCH] [Cache | Trunk]: Resolved some warnings git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@58226 d315682c-612b-4755-9ff5-7f18f6832af3 --- services/cache/mecache/cache.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/cache/mecache/cache.js b/services/cache/mecache/cache.js index 4a24d235..9d081705 100644 --- a/services/cache/mecache/cache.js +++ b/services/cache/mecache/cache.js @@ -30,13 +30,13 @@ let cache = (duration) => { return (req, res, next) => { let key = '__express__' + req.originalUrl || req.url console.log(req.originalUrl || req.url); - let cachedBody = mcache.get(key) + let cachedBody = mcache.get(key); if (cachedBody) { res.send(JSON.parse(cachedBody)) } else { - res.sendResponse = res.send + res.sendResponse = res.send; res.send = (body) => { - if (res.statusCode == 200) { + if (res.statusCode === 200) { mcache.put(key, body, duration * 1000); } res.sendResponse(body) @@ -45,7 +45,7 @@ let cache = (duration) => { next(); } }; -} +}; app.get('/metrics', (req, res) => {