| | |
| | | /** |
| | | * 点位在线检测 |
| | | */ |
| | | //TODO:视频离线次数、监测次数 |
| | | public void pointOnline() throws ExecutionException, InterruptedException { |
| | | log.info("开始检测点位在线"); |
| | | Integer times = 2; |
| | |
| | | OnlineCheckThread thread = new OnlineCheckThread(monitor, checkPointUtil, time); |
| | | return thread.call(); // 假设 OnlineCheckThread 实现了 Callable 接口 |
| | | }, executorService) |
| | | .orTimeout(30, TimeUnit.SECONDS) |
| | | .orTimeout(40, TimeUnit.SECONDS) |
| | | .exceptionally(ex -> { |
| | | if (ex instanceof TimeoutException) { |
| | | log.error("任务执行超时:"); |
| | | log.error("任务执行超时:"+monitor.getIp()); |
| | | } else { |
| | | log.error("任务执行异常:" + ex); |
| | | log.error("任务执行异常:"+monitor.getIp() + ex); |
| | | } |
| | | int checkTimes = 1; |
| | | int offLineTimes = 1; |
| | |
| | | allOf.get(35, TimeUnit.SECONDS); // 给予额外的5秒来收集结果 |
| | | } catch (TimeoutException e) { |
| | | log.warn("部分任务未在指定时间内完成"); |
| | | } catch (Exception e2){ |
| | | log.error("数据收集异常"+e2); |
| | | } |
| | | |
| | | dataList = futureList.stream() |