From 0c5a58771fcf86ad0b562829fbfa440da9392703 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期三, 17 十二月 2025 09:08:16 +0800
Subject: [PATCH] #

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

diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index 9cf6d99..549e663 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -17,8 +17,6 @@
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
 import java.util.List;
 
 /**
@@ -35,7 +33,6 @@
     @Autowired
     private DeviceConfigService deviceConfigService;
 
-    @PostConstruct
     @Async
     public void init() throws InterruptedException {
         News.info("鏍稿績鎺у埗灞傚紑濮嬪垵濮嬪寲...............................................");
@@ -94,7 +91,10 @@
                 throw new CoolException("鏈煡鐨勭嚎绋嬪疄鐜�");
             }
 
-            new Thread(thread).start();
+            Thread t = new Thread(thread);
+            t.setName("CrnThread-" + deviceConfig.getDeviceNo());
+            t.setDaemon(true);
+            t.start();
             SlaveConnection.put(SlaveType.Crn, deviceConfig.getDeviceNo(), thread);
         }
 
@@ -109,7 +109,10 @@
                 throw new CoolException("鏈煡鐨勭嚎绋嬪疄鐜�");
             }
 
-            new Thread(thread).start();
+            Thread t = new Thread(thread);
+            t.setName("DevpThread-" + deviceConfig.getDeviceNo());
+            t.setDaemon(true);
+            t.start();
             SlaveConnection.put(SlaveType.Devp, deviceConfig.getDeviceNo(), thread);
         }
 
@@ -124,16 +127,13 @@
                 throw new CoolException("鏈煡鐨勭嚎绋嬪疄鐜�");
             }
 
-            new Thread(thread).start();
+            Thread t = new Thread(thread);
+            t.setName("RgvThread-" + deviceConfig.getDeviceNo());
+            t.setDaemon(true);
+            t.start();
             SlaveConnection.put(SlaveType.Rgv, deviceConfig.getDeviceNo(), thread);
         }
 
     }
-
-
-    @PreDestroy
-    public void destroy() {
-    }
-
 
 }

--
Gitblit v1.9.1