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();
|
||
|
|
}
|
||
|
|
}
|