mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
bugfix 修复报错
This commit is contained in:
@@ -117,6 +117,8 @@ public class NettyServerHandler extends ChannelInboundHandlerAdapter {
|
||||
|
||||
// 优化:增加消息处理耗时监控,用于排查性能问题
|
||||
long elapsed = System.currentTimeMillis() - startTime;
|
||||
// 从 AttributeKey 获取 frameType,避免作用域问题
|
||||
String frameType = ctx.channel().attr(LAST_FRAME_TYPE).get();
|
||||
// 心跳帧(0x03)处理超过50ms警告,其他帧超过200ms警告
|
||||
int warnThreshold = "0x03".equals(frameType) ? 50 : 200;
|
||||
if (elapsed > warnThreshold) {
|
||||
|
||||
Reference in New Issue
Block a user