Browse Source

更新online计时 默认888888不记录

gemercheung 2 năm trước cách đây
mục cha
commit
f62358cca5
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 8 2
      src/service/publishService.js

+ 8 - 2
src/service/publishService.js

@@ -20,7 +20,10 @@ const publishEnterRoom = (userId, roomId) => {
     type: 0,
     createTime: Date.now(),
   };
-  pubClient.hSet(getInKey(onlineConfigKey), `${payLoad.createTime}`, JSON.stringify(payLoad));
+  // 默认888888不记录
+  if (roomId !== "888888") {
+    pubClient.hSet(getInKey(onlineConfigKey), `${payLoad.createTime}`, JSON.stringify(payLoad));
+  }
   pubClient.publish("enterRoom", JSON.stringify(payLoad));
 };
 const publishExitRoom = (userId, roomId) => {
@@ -37,7 +40,10 @@ const publishExitRoom = (userId, roomId) => {
     type: -1,
     createTime: Date.now(),
   };
-  pubClient.hSet(getInKey(onlineConfigKey), `${payLoad.createTime}`, JSON.stringify(payLoad));
+  // 默认888888不记录
+  if (roomId !== "888888") {
+    pubClient.hSet(getInKey(onlineConfigKey), `${payLoad.createTime}`, JSON.stringify(payLoad));
+  }
   pubClient.publish("exitRoom", JSON.stringify(payLoad));
 };