|
|
@@ -26,7 +26,7 @@ import java.net.UnknownHostException; |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class SynProjectCollectionTask { |
|
|
|
|
|
|
|
@Value("${task.host}") |
|
|
|
@Value("${hostname}") |
|
|
|
public String HOST; |
|
|
|
|
|
|
|
@Value("${spring.profiles.active}") |
|
|
@@ -43,7 +43,7 @@ public class SynProjectCollectionTask { |
|
|
|
* 定时同步前置机数据 每天1点开始执行一次 |
|
|
|
* |
|
|
|
*/ |
|
|
|
@Scheduled(cron = "0 10 16 * * ?") |
|
|
|
@Scheduled(cron = "0 0 1 * * ?") |
|
|
|
public void doTask() throws UnknownHostException { |
|
|
|
if (!HOST.equals(InetAddress.getLocalHost().getHostName())) { |
|
|
|
log.info("定时器没开启或者host不对! {}:{}", |
|
|
|