From 0d8fcb1505ba869290cce9099b42370e4333b708 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期四, 05 六月 2025 09:44:43 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/ServerBootstrap.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index c7cec42..7a274af 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -32,6 +32,8 @@
     @Autowired
     private MainProcess mainProcess;
 
+    int CRN_COUNT = 0;
+
     public static final Map<CrnThread, Thread> map = new ConcurrentHashMap<>();
 
 
@@ -142,13 +144,15 @@
 
         @Scheduled(cron = "0/3 * * * * ? ")
         public void kill() {
-            int i = 0;
             for (Map.Entry<CrnThread, Thread> entry : map.entrySet()) {
-                i++;
+                CRN_COUNT++;
                 SiemensCrnThread key = (SiemensCrnThread) entry.getKey();
 //                System.out.println("绗�"+i+"涓爢鍨涙満绾跨▼閲嶅惎绾跨▼鏉′欢锛�"+(System.currentTimeMillis() - key.getSign()));
-                if (System.currentTimeMillis() - key.getSign() > 120000) {
-                    System.out.println("绗�"+i+"涓爢鍨涙満绾跨▼琚噸鍚�");
+                if (CRN_COUNT>10000){
+                    continue;
+                }
+                if (System.currentTimeMillis() - key.getSign() > 120000 && System.currentTimeMillis() - key.getSign()<1200000) {
+                    System.out.println("绗�"+CRN_COUNT+"涓爢鍨涙満绾跨▼琚噸鍚�");
 
                     // 璇锋眰绾跨▼瀹夊叏鍋滄
                     key.requestStop();

--
Gitblit v1.9.1