Skip to content

Commit e7bad5a

Browse files
committed
add expire time for user cache
1 parent bb0a002 commit e7bad5a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

proxy/user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ exports.getUserById = function (id, isCache, callback) {
6666

6767
ep.on('user', function (user) {
6868
if (user) {
69-
cache.set(String(user._id), user);
69+
// 缓存用户信息五分钟
70+
cache.set(String(user._id), 5 * 60 * 1000, user);
7071
}
7172
callback(null, user);
7273
});

0 commit comments

Comments
 (0)