mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
解决 Netty 合并冲突并添加耗时监控
- 解决 NettyServerHandler.java 的 Git 合并冲突 - 添加消息处理耗时监控到 channelRead 方法 - 更新 improve_record.md 优化记录文档
This commit is contained in:
@@ -168,6 +168,16 @@ public class CacheConstants {
|
||||
*/
|
||||
public static final String PILE_LAST_CONNECTION = "pile_last_connection:";
|
||||
|
||||
/**
|
||||
* 充电桩待确认断链标记
|
||||
*/
|
||||
public static final String PILE_PENDING_DISCONNECT = "pile_pending_disconnect:";
|
||||
|
||||
/**
|
||||
* 充电桩已确认离线标记
|
||||
*/
|
||||
public static final String PILE_OFFLINE_CONFIRMED = "pile_offline_confirmed:";
|
||||
|
||||
/**
|
||||
* 查询枪口信息列表前缀
|
||||
*/
|
||||
|
||||
@@ -153,6 +153,21 @@ public class PileChannelEntity {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean removeByPileSnAndChannelId(String pileSn, String expectedChannelId) {
|
||||
if (StringUtils.isBlank(pileSn) || StringUtils.isBlank(expectedChannelId)) {
|
||||
return false;
|
||||
}
|
||||
ChannelHandlerContext currentCtx = manager.get(pileSn);
|
||||
if (currentCtx == null || currentCtx.channel() == null) {
|
||||
return false;
|
||||
}
|
||||
String currentChannelId = currentCtx.channel().id().asLongText();
|
||||
if (!StringUtils.equals(currentChannelId, expectedChannelId)) {
|
||||
return false;
|
||||
}
|
||||
return manager.remove(pileSn, currentCtx);
|
||||
}
|
||||
|
||||
public static void removeByChannelId(String channelId){
|
||||
if (StringUtils.isBlank(channelId)) {
|
||||
return;
|
||||
@@ -165,4 +180,4 @@ public class PileChannelEntity {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user