zhaotx 1 yıl önce
ebeveyn
işleme
21336ae024

+ 6 - 2
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/HealthCheckServiceImpl.java

@@ -32,13 +32,17 @@ public class HealthCheckServiceImpl implements IHealthCheckService {
         List<String> ips = Arrays.asList(
 //                "192.168.1.33"//localhost
                 "123.57.9.211"//test
+//                "172.16.0.108",
+//                "172.16.0.130",
+//                "172.16.0.131",
+//                "172.16.0.144"
         );
 
         Map<String, Integer> ipErrorCount = new HashMap<>();
         for (String ip : ips) {
             ipErrorCount.put(ip, 0);
         }
-        for (int i = 0; i < 8; i++) {
+        for (int i = 0; i < 10; i++) {
             for (String ip : ips) {
                 String url = "http://" + ip + ":9002/monitor/server/healthCheck";
                 System.out.println(url);
@@ -54,7 +58,7 @@ public class HealthCheckServiceImpl implements IHealthCheckService {
                     ipErrorCount.put(ip, ipErrorCount.get(ip) + 1);
                 }
             }
-            Thread.sleep(1500);
+            Thread.sleep(5000);
         }
 
         for (String ip : ips) {

+ 23 - 0
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/DeepthinkHealthCheckJob.java

@@ -0,0 +1,23 @@
+package cn.com.ctop.job.bytedance.handler;
+
+import cn.com.ctop.job.bytedance.data.service.IHealthCheckService;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class DeepthinkHealthCheckJob {
+    @Autowired
+    IHealthCheckService healthCheckService;
+
+    @XxlJob("deepthinkHealthCheckJob")
+    public void deepthinkHealthCheckJob(){
+        try {
+            healthCheckService.check();
+        } catch (Exception e) {
+            log.error("DeepthinkHealthCheckJob error: ", e);
+        }
+    }
+}