- 将application.yml中的inspection配置项重命名为resource - 更新开发环境配置文件端口号从13080改为14080 - 在数据库连接URL中引入CMVR_DB_NAME环境变量 - 配置Redis数据库索引使用CMVR_REDIS_DATABASE环境变量 - 在测试环境中添加资源中心隔离配置 - 移除设备配置信息相关的域模型、控制器、数据访问层及映射文件 - 移除设备注册相关的域模型、控制器、数据访问层及映射文件
21 lines
822 B
Java
21 lines
822 B
Java
package com.cmvr.resource.task;
|
|
|
|
import com.cmvr.resource.service.ResourceQuicStateSynchronizer;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Component
|
|
@RequiredArgsConstructor
|
|
@ConditionalOnProperty(prefix = "cmvr.quic", name = "enabled", havingValue = "true")
|
|
public class ResourceRobotHeartbeatExpiryTask {
|
|
private final ResourceQuicStateSynchronizer synchronizer;
|
|
|
|
@Scheduled(initialDelayString = "${cmvr.resource.robot-state.initial-delay-ms:3000}",
|
|
fixedDelayString = "${cmvr.resource.robot-state.heartbeat-check-ms:5000}")
|
|
public void expireStaleRobots() {
|
|
synchronizer.expireStaleRobots();
|
|
}
|
|
}
|