feat: use contentExpire

This commit is contained in:
DIYgod
2019-05-09 01:23:29 +08:00
parent 075a8d1864
commit a0333fbd7e
140 changed files with 199 additions and 218 deletions

View File

@@ -38,7 +38,7 @@ module.exports = async (ctx) => {
description: description,
pubDate: new Date(date).toUTCString(),
};
ctx.cache.set(itemUrl, JSON.stringify(single), 24 * 60 * 60);
ctx.cache.set(itemUrl, JSON.stringify(single));
return Promise.resolve(single);
})
);

View File

@@ -51,7 +51,7 @@ module.exports = async (ctx) => {
});
item.description = $('#articleContent').html();
ctx.cache.set(key, item.description, 24 * 60 * 60);
ctx.cache.set(key, item.description);
}
return Promise.resolve(item);

View File

@@ -40,7 +40,7 @@ module.exports = async (ctx) => {
author: author,
pubDate: new Date(date).toUTCString(),
};
ctx.cache.set(itemUrl, JSON.stringify(single), 24 * 60 * 60);
ctx.cache.set(itemUrl, JSON.stringify(single));
return Promise.resolve(single);
})
);

View File

@@ -44,7 +44,7 @@ module.exports = async (ctx) => {
});
item.description = $('.art-cont').html();
ctx.cache.set(key, item.description, 24 * 60 * 60);
ctx.cache.set(key, item.description);
}
return Promise.resolve(item);

View File

@@ -53,7 +53,7 @@ module.exports = async (ctx) => {
author: author,
pubDate: new Date(date).toUTCString(),
};
ctx.cache.set(itemUrl, JSON.stringify(single), 24 * 60 * 60);
ctx.cache.set(itemUrl, JSON.stringify(single));
return Promise.resolve(single);
})
);

View File

@@ -44,7 +44,7 @@ module.exports = async (ctx) => {
});
item.description = $(`#${id}`).html();
ctx.cache.set(key, item.description, 24 * 60 * 60);
ctx.cache.set(key, item.description);
}
return Promise.resolve(item);