mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-14 17:19:37 +08:00
Update tryGet() and use default parameters
This commit is contained in:
@@ -42,13 +42,13 @@ module.exports = function(options = {}) {
|
||||
|
||||
options.app.context.cache = {
|
||||
/* eslint-disable no-unused-vars */
|
||||
get: async (key, persistent) => {
|
||||
get: async (key, persistent = false) => {
|
||||
/* eslint-enable no-unused-vars */
|
||||
if (key) {
|
||||
return await redisClient.get(key);
|
||||
}
|
||||
},
|
||||
set: async (key, value, maxAge, persistent) => {
|
||||
set: async (key, value, maxAge, persistent = false) => {
|
||||
if (!value || value === 'undefined') {
|
||||
value = '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user