From cd04aa8b887e82ec664e42f0bc353c079be1d2c5 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 27 四月 2026 17:57:19 +0800
Subject: [PATCH] fix: filter auto tune out station limits
---
src/main/java/com/zy/core/ServerBootstrap.java | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/zy/core/ServerBootstrap.java b/src/main/java/com/zy/core/ServerBootstrap.java
index 68cc1a2..82d1ebd 100644
--- a/src/main/java/com/zy/core/ServerBootstrap.java
+++ b/src/main/java/com/zy/core/ServerBootstrap.java
@@ -7,6 +7,7 @@
import com.zy.common.utils.RedisUtil;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
+import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.SlaveType;
import com.zy.core.thread.impl.*;
@@ -24,6 +25,8 @@
@Component
public class ServerBootstrap {
+ private static boolean initThread = false;
+
@Autowired
private MainProcess mainProcess;
@Autowired
@@ -33,14 +36,28 @@
@Async
public void init() throws InterruptedException {
+ if (initThread) {
+ return;
+ }
News.info("鏍稿績鎺у埗灞傚紑濮嬪垵濮嬪寲...............................................");
+ clearStartupRuntimeLocks();
// 鍒濆鍖栨秷鎭槦鍒�
initMq();
// 鍒濆鍖栦笅浣嶆満绾跨▼
initThread();
// 寮�濮嬩富娴佺▼杩涚▼
mainProcess.start();
+ initThread = true;
News.info("鏍稿績鎺у埗灞傚凡鍚姩...............................................");
+ }
+
+ private void clearStartupRuntimeLocks() {
+ redisUtil.del(RedisKeyType.STATION_EXECUTE_COMMAND_LOCK.key);
+ java.util.Set<String> stationSendLockKeys = redisUtil.scanKeys(RedisKeyType.STATION_EXECUTE_COMMAND_LOCK.key + ":", 2048);
+ if (stationSendLockKeys != null && !stationSendLockKeys.isEmpty()) {
+ redisUtil.del(stationSendLockKeys.toArray(new String[0]));
+ }
+// News.info("绯荤粺鍚姩鏃跺凡娓呯悊杈撻�佺珯鍛戒护鎵ц閿侊紝key={}", RedisKeyType.STATION_EXECUTE_COMMAND_LOCK.key);
}
private void initMq(){
@@ -135,8 +152,8 @@
thread = new ZyStationThread(deviceConfig, redisUtil);
} else if (deviceConfig.getThreadImpl().equals("ZyStationV3Thread")) {
thread = new ZyStationV3Thread(deviceConfig, redisUtil);
- } else if (deviceConfig.getThreadImpl().equals("ZyStationV4Thread")) {
- thread = new ZyStationV4Thread(deviceConfig, redisUtil);
+ } else if (deviceConfig.getThreadImpl().equals("ZyStationV5Thread")) {
+ thread = new ZyStationV5Thread(deviceConfig, redisUtil);
} else {
throw new CoolException("鏈煡鐨勭嚎绋嬪疄鐜�");
}
--
Gitblit v1.9.1