From 59e5a0188cd8f7463ebcd7ef0ec3eff283da4cbb Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Thu, 26 Jun 2014 10:02:54 -0500 Subject: [PATCH] Expose setex if exists and is a function This allows us to use the cache store with a ttl on some transactions, but not all. --- lib/caching.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/caching.js b/lib/caching.js index f410a19..72e6a70 100644 --- a/lib/caching.js +++ b/lib/caching.js @@ -58,6 +58,10 @@ var caching = function (args) { self.del = self.store.del.bind(self.store); + if (typeof self.store.setex === 'function') { + self.setex = self.store.setex.bind(self.store); + } + if (typeof self.store.reset === 'function') { self.reset = self.store.reset.bind(self.store); }