Przeglądaj źródła

改为定时器 同步项目归集

tags/24080901
PoffyZhang 1 rok temu
rodzic
commit
7fcdc0caf1
2 zmienionych plików z 2 dodań i 4 usunięć
  1. +0
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java
  2. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java

+ 0
- 2
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java Wyświetl plik

@@ -205,8 +205,6 @@ public class AppIrsManage {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);

log.info("查询应用目录 : {}", JSON.toJSONString(forEntity));

if (Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody())) {
JSONObject body = JSON.parseObject(forEntity.getBody());
if (Objects.isNull(body)) {


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCollectionTask.java Wyświetl plik

@@ -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不对! {}:{}",


Ładowanie…
Anuluj
Zapisz