From d2dbfe9ac555029ac6332703912ac7b753304aaf Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 06 三月 2026 15:52:01 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java b/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
index 245446b..f833e51 100644
--- a/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZyStationV4Thread.java
@@ -47,6 +47,7 @@
private RedisUtil redisUtil;
private ZyStationConnectDriver zyStationConnectDriver;
private int deviceLogCollectTime = 200;
+ private boolean initStatus = false;
private long deviceDataLogTime = System.currentTimeMillis();
private ExecutorService executor = Executors.newFixedThreadPool(9999);
@@ -64,14 +65,16 @@
Thread readThread = new Thread(() -> {
while (true) {
try {
- deviceLogCollectTime = Utils.getDeviceLogCollectTime();
+ if (initStatus) {
+ deviceLogCollectTime = Utils.getDeviceLogCollectTime();
+ }
readStatus();
Thread.sleep(100);
} catch (Exception e) {
log.error("StationV4Thread Fail", e);
}
}
- });
+ }, "DevpRead-" + deviceConfig.getDeviceNo());
readThread.start();
Thread processThread = new Thread(() -> {
@@ -91,7 +94,7 @@
log.error("StationV4Process Fail", e);
}
}
- });
+ }, "DevpProcess-" + deviceConfig.getDeviceNo());
processThread.start();
}
@@ -122,6 +125,7 @@
stationProtocol.setStationId(entity.getStationId());
statusList.add(stationProtocol);
}
+ initStatus = true;
}
List<ZyStationStatusEntity> zyStationStatusEntities = zyStationConnectDriver.getStatus();
--
Gitblit v1.9.1