From 2233d993c21ee2db32a4a7ce3abe80ff38702417 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 20 Dec 2017 15:27:55 -0700 Subject: [PATCH] fixed expiry loading --- graph/loaders/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graph/loaders/util.js b/graph/loaders/util.js index fe2a4e3d0a..4d43d18116 100644 --- a/graph/loaders/util.js +++ b/graph/loaders/util.js @@ -72,8 +72,10 @@ class SharedCacheDataLoader extends DataLoader { constructor(prefix, expiry, batchLoadFn, options) { super(SharedCacheDataLoader.batchLoadFn(prefix, expiry, batchLoadFn), options); + // Expiry is provided as a number in ms, we're using commands optimized for + // seconds, so convert this to seconds. + this._expiry = Math.floor(expiry / 1000); this._prefix = prefix; - this._expiry = expiry; this._keyFunc = SharedCacheDataLoader.keyFunc(this._prefix); }