Update tryGet() and use default parameters

This commit is contained in:
Henry
2019-01-28 21:21:22 +00:00
parent 4227c30d77
commit 0bfa79e762
3 changed files with 7 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ module.exports = function(options = {}) {
});
options.app.context.cache = {
get: (key, persistent) => {
get: (key, persistent = false) => {
if (key) {
if (persistent) {
return persistentCache.get(key);
@@ -35,7 +35,7 @@ module.exports = function(options = {}) {
}
}
},
set: (key, value, maxAge, persistent) => {
set: (key, value, maxAge, persistent = false) => {
if (!value || value === 'undefined') {
value = '';
}