From cb482ae626f89d5e8c39982e5a024ba55a4c70dc Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Mon, 18 Sep 2023 14:30:53 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E6=B5=8B=E8=AF=95=E5=80=BC=E4=B8=8D?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index e96fd86..8ba5511 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -185,7 +185,7 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC Object his = accessor_value.getValue(itemId); if (itemState.getQuality()==QualityTypeValue.OPC_QUALITY_GOOD && his != null) { log.warn("opc 值不健康 item: {}, 状态: {}", itemId, itemState.getQuality()); - valueAllNotNull = true; + valueAllNotNull = false; } if (!UnifiedDataAppService.isEquals(value, his)) { @@ -218,8 +218,8 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC if (log.isWarnEnabled()) { log.warn("{} 所有内容都为空, all_null:{} ,暂定{}s", tag, all_null,5000 + random); } - - ThreadUtl.sleep((long) (5000 + random)); + ThreadUtl.sleep((long) ((new Random()).nextInt(3) +1) * 1000); + break start; } else if (this.all_null < 6) { if (log.isWarnEnabled()) { log.warn(tag + "重新创建server");