Browse Source

改为定时器 同步项目归集

master
PoffyZhang 1 year ago
parent
commit
59b1bb0e22
1 changed files with 4 additions and 7 deletions
  1. +4
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java

+ 4
- 7
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java View File

@@ -26,9 +26,6 @@ import java.net.UnknownHostException;
@RequiredArgsConstructor
public class SynProjectCollectionTask {

@Value("${task.switch.is-open}")
private boolean flag;

@Value("${task.host}")
public String HOST;

@@ -46,11 +43,11 @@ public class SynProjectCollectionTask {
* 定时同步前置机数据 每天1点开始执行一次
*
*/
@Scheduled(cron = "0 5 16 * * ?")
@Scheduled(cron = "0 10 16 * * ?")
public void doTask() throws UnknownHostException {
if (!flag || !HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("定时器没开启或者host不对! {} {}:{}",
flag,HOST,InetAddress.getLocalHost().getHostName());
if (!HOST.equals(InetAddress.getLocalHost().getHostName())) {
log.info("定时器没开启或者host不对! {}:{}",
HOST,InetAddress.getLocalHost().getHostName());
}
if(BizConst.PRE.equals(active)){
log.info("预发环境不用同步!");


Loading…
Cancel
Save