update count even if its 0

This commit is contained in:
barisusakli
2015-10-27 14:01:13 -04:00
parent 7ee584b632
commit 4ef2ae7ba2

View File

@@ -66,9 +66,10 @@ module.exports = function(Topics) {
function updateTagCount(tag, callback) {
callback = callback || function() {};
Topics.getTagTopicCount(tag, function(err, count) {
if (err || !count) {
if (err) {
return callback(err);
}
count = count || 0;
db.sortedSetAdd('tags:topic:count', count, tag, callback);
});