From 2724ee7b9cf0568e9f67d87d789d1827ead55555 Mon Sep 17 00:00:00 2001 From: Stephane BACHELIER Date: Mon, 25 Apr 2016 01:26:32 +0200 Subject: [PATCH] fix(cache): return promise to not break promise chain --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 97466e4..6fc2aa5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -57,7 +57,7 @@ function cache (config = {}) { return config.readCache(req, config.log)(value) .catch(err => { // clean up cache if stale - config.clearOnStale && err.reason === 'cache-stale' ? config.store.removeItem(uuid).then(f) : f() + return config.clearOnStale && err.reason === 'cache-stale' ? config.store.removeItem(uuid).then(f) : f() }) }) }