fixed LRU cache problem

This commit is contained in:
Julian Lam
2015-11-26 23:34:55 -05:00
parent c3560f677c
commit bbc42a937e

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);
}
@@ -38,4 +37,4 @@ module.exports = function(Posts) {
plugins.fireHook('filter:parse.signature', {userData: userData, uid: uid}, callback);
};
};
};