Style tweaks
This commit is contained in:
parent
26ba4698e3
commit
2f7f805cd6
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue