mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-06 14:07:49 +08:00
修复时间统计列表处理逻辑并增强心跳记录更新的异常处理
This commit is contained in:
parent
2b090bbf23
commit
0dc297bf02
@ -1307,7 +1307,9 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
|
||||
}
|
||||
timeStatisticsList.add(timeStatistics);
|
||||
}
|
||||
if (timeStatisticsList.size() > count) {
|
||||
// 第一个数据由于没有上一个时间戳,无法计算时间差,去掉
|
||||
timeStatisticsList.removeFirst();
|
||||
if (timeStatisticsList.size() - 1 > count) {
|
||||
timeStatisticsList = timeStatisticsList.subList(timeStatisticsList.size() - count, timeStatisticsList.size());
|
||||
}
|
||||
return timeStatisticsList;
|
||||
|
||||
@ -94,9 +94,13 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp
|
||||
}
|
||||
@Scheduled(fixedDelay = 10, timeUnit = TimeUnit.SECONDS)
|
||||
public void executeUpdateDeviceList() {
|
||||
if (!taskQueue.isEmpty()) {
|
||||
redisCatchStorage.updateDeviceKeepaliveTimeStamp(taskQueue.stream().toList());
|
||||
taskQueue.clear();
|
||||
try {
|
||||
if (!taskQueue.isEmpty()) {
|
||||
redisCatchStorage.updateDeviceKeepaliveTimeStamp(taskQueue.stream().toList());
|
||||
taskQueue.clear();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("[定时任务] 更新心跳记录 执行异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user