disable post cache on prod, dont set it if no pid

This commit is contained in:
Barış Soner Uşaklı
2015-11-26 18:03:41 -05:00
parent cee3918e9b
commit 4d13fb6809

View File

@@ -24,7 +24,10 @@ module.exports = function(Posts) {
if (err) {
return callback(err);
}
cache.set(data.postData.pid, data.postData.content);
if (global.env === 'production' && data.postData.pid) {
cache.set(data.postData.pid, data.postData.content);
}
callback(null, data.postData);
});
@@ -35,4 +38,4 @@ module.exports = function(Posts) {
plugins.fireHook('filter:parse.signature', {userData: userData, uid: uid}, callback);
};
};
};