xsx 1 년 전
부모
커밋
03435f6c00
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      im-server/src/main/java/com/bx/imserver/netty/processor/LoginProcessor.java

+ 1 - 1
im-server/src/main/java/com/bx/imserver/netty/processor/LoginProcessor.java

@@ -62,7 +62,7 @@ public class LoginProcessor extends AbstractMessageProcessor<IMLoginInfo> {
         AttributeKey<Integer> terminalAttr = AttributeKey.valueOf(ChannelAttrKey.TERMINAL_TYPE);
         ctx.channel().attr(terminalAttr).set(terminal);
         // 初始化心跳次数
-        AttributeKey<Long> heartBeatAttr = AttributeKey.valueOf("HEARTBEAt_TIMES");
+        AttributeKey<Long> heartBeatAttr = AttributeKey.valueOf(ChannelAttrKey.HEARTBEAT_TIMES);
         ctx.channel().attr(heartBeatAttr).set(0L);
         // 在redis上记录每个user的channelId,15秒没有心跳,则自动过期
         String key = String.join(":", IMRedisKey.IM_USER_SERVER_ID, userId.toString(), terminal.toString());