huangzhen
2023-12-19 2dd2e7f54db7149965acaa11d933f85b31fbd59c
src/main/java/com/gkhy/fourierSpecialGasMonitor/schedule/HeartbeatSchedule.java
@@ -25,7 +25,7 @@
 * @decription
 * @date 2023/8/8 10:49
 */
@Component
//@Component
public class HeartbeatSchedule {
    @Autowired
@@ -42,11 +42,10 @@
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    //@Scheduled(cron = "1 * * * * *") // 每分钟执行一次
    @Scheduled(cron = "1 * * * * ?") // 每天凌晨执行
    @Scheduled(cron = "0/1 * * * * ?") // 每秒执行一次
    @Async(value = "SocketTaskExecutor")
    public void gasConcentrationStatus() {
        GasConcentration gasConcentration = gasConcentrationService.getLastData();
        if (gasConcentration != null){
            LocalDateTime lastReceiveTime = gasConcentration.getDataReceivingTime().plusMinutes(1);
@@ -61,7 +60,7 @@
                    if (save == null)
                        throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"设备异常日志保存失败");
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_WEBSOCKET_SEND_INFO_FAIL.getCode(),"设备异常消息推送失败");
                }
            }
        }
@@ -84,7 +83,7 @@
                    if (save == null)
                        throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_DATABASE_FAIL.getCode(),"设备异常日志保存失败");
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new BusinessException(this.getClass(), ResultCode.SYSTEM_ERROR_WEBSOCKET_SEND_INFO_FAIL.getCode(),"设备异常消息推送失败");
                }
            }
        }