fixed LRU cache problem

v1.18.x
Julian Lam 9 years ago
parent c3560f677c
commit bbc42a937e

@ -9,9 +9,8 @@ module.exports = function(Posts) {
Posts.parsePost = function(postData, callback) { Posts.parsePost = function(postData, callback) {
postData.content = postData.content || ''; postData.content = postData.content || '';
var cachedContent = cache.get(postData.pid); if (postData.pid && cache.has(postData.pid)) {
if (cachedContent) { postData.content = cache.get(postData.pid);
postData.content = cachedContent;
return callback(null, postData); return callback(null, postData);
} }
@ -38,4 +37,4 @@ module.exports = function(Posts) {
plugins.fireHook('filter:parse.signature', {userData: userData, uid: uid}, callback); plugins.fireHook('filter:parse.signature', {userData: userData, uid: uid}, callback);
}; };
}; };

Loading…
Cancel
Save