| | |
| | | |
| | | private static final ExecutorService executorService = new ThreadPoolExecutor(16, |
| | | 64, |
| | | 5000, |
| | | 60, |
| | | TimeUnit.SECONDS, |
| | | new ArrayBlockingQueue<>(1000), |
| | | new ThreadPoolExecutor.CallerRunsPolicy() |
| | |
| | | OnlineCheckThread thread = new OnlineCheckThread(monitor, checkPointUtil, time); |
| | | return thread.call(); // 假设 OnlineCheckThread 实现了 Callable 接口 |
| | | }, executorService) |
| | | .orTimeout(120, TimeUnit.SECONDS) |
| | | .orTimeout(180, TimeUnit.SECONDS) |
| | | .exceptionally(ex -> { |
| | | if (ex instanceof TimeoutException) { |
| | | log.error("任务执行超时:"+monitor.getIp()); |