fixed LRU cache problem

This commit is contained in:
Julian Lam
2015-11-26 23:34:55 -05:00
parent f0c4052725
commit 6d9adac6e4

View File

@@ -9,9 +9,8 @@ module.exports = function(Posts) {
Posts.parsePost = function(postData, callback) {
postData.content = postData.content || '';
var cachedContent = cache.get(postData.pid);
if (cachedContent) {
postData.content = cachedContent;
if (postData.pid && cache.has(postData.pid)) {
postData.content = cache.get(postData.pid);
return callback(null, postData);
}