cl
3 天以前 9e9d5d9aed6a29b8b6b1c38cfbb7fb94b21c478b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.vincent.rsf.openApi.tv;
 
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
 
/**
 * 定时拉 RCS 站点数据写入 Redis,电视机侧沿用既有 WebSocket 推送
 */
@Slf4j
@Component
@ConditionalOnProperty(prefix = "tv-monitor.rcs-station-poll", name = "enabled", havingValue = "true")
public class TvRcsStationPollSchedule {
 
    @Resource
    private TvRcsStationPollService tvRcsStationPollService;
 
    @Scheduled(cron = "${tv-monitor.rcs-station-poll.cron:0/5 * * * * ?}")
    public void pollRcsStationToTvRedis() {
        tvRcsStationPollService.pollOnce();
    }
}