fix: 定时任务逻辑修改,回查不管是否成功,都返回true。

This commit is contained in:
tianyongbao
2026-03-27 17:55:29 +08:00
parent 4c1dc90f3a
commit aa89543946

View File

@@ -2698,7 +2698,7 @@ public class IotController extends BaseController {
Thread.sleep(1000L); Thread.sleep(1000L);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
return false; break;
} }
try { try {
Map<String, Object> queryResult = iotCloudService.getDeviceProperties(device.getIotId()); Map<String, Object> queryResult = iotCloudService.getDeviceProperties(device.getIotId());
@@ -2741,7 +2741,9 @@ public class IotController extends BaseController {
if (actualIsValid == expectedIsValid) { if (actualIsValid == expectedIsValid) {
log.info("[TimerCtrl] 回查确认设备已收到定时控制设置, iotId={}, key={}, isValid={}", log.info("[TimerCtrl] 回查确认设备已收到定时控制设置, iotId={}, key={}, isValid={}",
device.getIotId(), propertyKey, actualIsValid); device.getIotId(), propertyKey, actualIsValid);
return true; } else {
log.warn("[TimerCtrl] 回查属性未匹配预期, retry={}, expectedIsValid={}, actualIsValid={}",
retry, expectedIsValid, actualIsValid);
} }
} }
} catch (Exception e2) { } catch (Exception e2) {
@@ -2752,16 +2754,14 @@ public class IotController extends BaseController {
} }
if (!matched) { if (!matched) {
log.warn("[TimerCtrl] 回查未找到属性 key={}, retry={}", propertyKey, retry); log.warn("[TimerCtrl] 回查未找到属性 key={}, retry={}", propertyKey, retry);
} else {
log.warn("[TimerCtrl] 回查属性未匹配预期, retry={}, expectedIsValid={}", retry, expectedIsValid);
} }
break;
} catch (Exception qe) { } catch (Exception qe) {
log.warn("[TimerCtrl] 回查查询异常, retry={}, err={}", retry, qe.getMessage()); log.warn("[TimerCtrl] 回查查询异常, retry={}, err={}", retry, qe.getMessage());
} }
} }
log.warn("[TimerCtrl] 回查重试完毕仍未确认设备收到, iotId={}, key={}", device.getIotId(), propertyKey); return true;
return false;
} catch (Exception e) { } catch (Exception e) {
log.error("设置定时控制属性失败: {}", e.getMessage(), e); log.error("设置定时控制属性失败: {}", e.getMessage(), e);
return false; return false;