diff --git a/src/user/blocks.js b/src/user/blocks.js index e2689d8df9..51bb4520f1 100644 --- a/src/user/blocks.js +++ b/src/user/blocks.js @@ -73,8 +73,8 @@ module.exports = function (User) { async.apply(db.sortedSetAdd.bind(db), 'uid:' + uid + ':blocked_uids', Date.now(), targetUid), async.apply(User.incrementUserFieldBy, uid, 'blocksCount', 1), function (_blank, next) { - User.blocks._cache.del(uid); - pubsub.publish('user:blocks:cache:del', uid); + User.blocks._cache.del(parseInt(uid, 10)); + pubsub.publish('user:blocks:cache:del', parseInt(uid, 10)); setImmediate(next); }, ], callback); @@ -86,8 +86,8 @@ module.exports = function (User) { async.apply(db.sortedSetRemove.bind(db), 'uid:' + uid + ':blocked_uids', targetUid), async.apply(User.decrementUserFieldBy, uid, 'blocksCount', 1), function (_blank, next) { - User.blocks._cache.del(uid); - pubsub.publish('user:blocks:cache:del', uid); + User.blocks._cache.del(parseInt(uid, 10)); + pubsub.publish('user:blocks:cache:del', parseInt(uid, 10)); setImmediate(next); }, ], callback);