Style tweaks

This commit is contained in:
Michael Jackson 2018-05-22 21:13:51 -04:00
parent 26ba4698e3
commit 2f7f805cd6
1 changed files with 4 additions and 1 deletions

View File

@ -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));
});
}