feat: cache category tag whitelist

This commit is contained in:
Barış Soner Uşaklı
2018-12-09 16:03:41 -05:00
parent 81aa3a0b8a
commit 78fa734017
4 changed files with 38 additions and 8 deletions

View File

@@ -137,6 +137,10 @@ module.exports = function (Categories) {
var scores = tags.map((tag, index) => index);
db.sortedSetAdd('cid:' + cid + ':tag:whitelist', scores, tags, next);
},
function (next) {
cache.del('cid:' + cid + ':tag:whitelist');
next();
},
], callback);
}