redis:玩家退出时,添加防报错

This commit is contained in:
luying
2022-09-09 18:23:41 +08:00
parent 623a7ad1f5
commit 3def913f74
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -366,7 +366,7 @@ export async function roleLeave(roleId: string) {
if(count <= 0) {
await redisClient().hdelAsync(REDIS_KEY.ONLINE_CNT, roleId);
await redisClient().hdelAsync(REDIS_KEY.ONLINE_USERS, roleId);
await redisClient().hdelAsync(REDIS_KEY.USER_CODE, role.userCode);
if(role) await redisClient().hdelAsync(REDIS_KEY.USER_CODE, role.userCode);
await redisClient().hdelAsync(REDIS_KEY.ONLINE_CNT, roleId);
}
return role;