diff --git a/server/utils/createCache.js b/server/utils/createCache.js index 546c8b6..caf2483 100644 --- a/server/utils/createCache.js +++ b/server/utils/createCache.js @@ -1,5 +1,8 @@ const db = require("./redis"); +/** + * A persistent cache for JSON values, using Redis. + */ function createCache(keyPrefix) { function createKey(key) { return keyPrefix + "-" + key; @@ -10,7 +13,7 @@ function createCache(keyPrefix) { } function get(key, callback) { - db.get(createKey(key), function(error, value) { + db.get(createKey(key), (error, value) => { callback(error, value && JSON.parse(value)); }); }