Commit f6f7e715 by 郑宁

解决条件任务无法执行的问题

parent bd8cdbef
...@@ -376,7 +376,10 @@ public class FlightTaskServiceImpl extends AbstractWaylineService implements IFl ...@@ -376,7 +376,10 @@ public class FlightTaskServiceImpl extends AbstractWaylineService implements IFl
} }
boolean isSuccess = this.prepareFlightTask(waylineJob); boolean isSuccess = this.prepareFlightTask(waylineJob);
if (!isSuccess) { if (isSuccess) {
// 任务准备成功
log.info("Prepare job successfully.{}", waylineJob.getJobId());
} else {
return HttpResultResponse.error("Failed to prepare job."); return HttpResultResponse.error("Failed to prepare job.");
} }
...@@ -664,11 +667,13 @@ public class FlightTaskServiceImpl extends AbstractWaylineService implements IFl ...@@ -664,11 +667,13 @@ public class FlightTaskServiceImpl extends AbstractWaylineService implements IFl
String blockedId = waylineRedisService.getBlockedWaylineJobId(response.getGateway()); String blockedId = waylineRedisService.getBlockedWaylineJobId(response.getGateway());
// fix: 修复条件任务不执行bug // fix: 修复条件任务不执行bug
if (StringUtils.hasText(blockedId)) { if (StringUtils.hasText(blockedId)) {
log.info("The conditional task is blocking and will not be executed.block id {}", blockedId);
return null; return null;
} }
Optional<DeviceDTO> deviceOpt = deviceRedisService.getDeviceOnline(response.getGateway()); Optional<DeviceDTO> deviceOpt = deviceRedisService.getDeviceOnline(response.getGateway());
if (deviceOpt.isEmpty()) { if (deviceOpt.isEmpty()) {
log.info("The device is offline.flight task ready!");
return null; return null;
} }
DeviceDTO device = deviceOpt.get(); DeviceDTO device = deviceOpt.get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment