add cache hits/misses to posts cache

This commit is contained in:
Barış Soner Uşaklı
2018-10-15 15:03:06 -04:00
parent b57db7fd8e
commit 6c15aee888
4 changed files with 12 additions and 0 deletions

View File

@@ -27,8 +27,10 @@ module.exports = function (Posts) {
if (postData.pid && cache.has(String(postData.pid))) {
postData.content = cache.get(String(postData.pid));
cache.hits += 1;
return callback(null, postData);
}
cache.misses += 1;
async.waterfall([
function (next) {