|
@@ -1,6 +1,7 @@
|
|
|
package com.its.op.scheduler;
|
|
package com.its.op.scheduler;
|
|
|
|
|
|
|
|
import com.its.op.config.JobConfig;
|
|
import com.its.op.config.JobConfig;
|
|
|
|
|
+import com.its.op.config.ProcessConfig;
|
|
|
import com.its.op.scheduler.job.*;
|
|
import com.its.op.scheduler.job.*;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -17,12 +18,14 @@ import javax.annotation.PreDestroy;
|
|
|
@Component
|
|
@Component
|
|
|
public class ItsApiScheduler {
|
|
public class ItsApiScheduler {
|
|
|
|
|
|
|
|
|
|
+ private final ProcessConfig processConfig;
|
|
|
private final JobConfig jobConfig;
|
|
private final JobConfig jobConfig;
|
|
|
private final CctvPsetCtrlScnrJobThread cctvPsetScnrThread;
|
|
private final CctvPsetCtrlScnrJobThread cctvPsetScnrThread;
|
|
|
private final FcltSttsJobThread fcltSttsJobThread;
|
|
private final FcltSttsJobThread fcltSttsJobThread;
|
|
|
private final UnitSttsJobThread unitSttsJobThread;
|
|
private final UnitSttsJobThread unitSttsJobThread;
|
|
|
private final BaseDbmsJobThread baseDbmsJobThread;
|
|
private final BaseDbmsJobThread baseDbmsJobThread;
|
|
|
- private final DbSvrSttsJobThread dbSvrSttsJobThread;
|
|
|
|
|
|
|
+ private final DbmsSttsJobThread dbmsSttsJobThread;
|
|
|
|
|
+ //private final DbSvrSttsJobThread dbSvrSttsJobThread;
|
|
|
|
|
|
|
|
@PreDestroy
|
|
@PreDestroy
|
|
|
public void onShutDown() {
|
|
public void onShutDown() {
|
|
@@ -34,6 +37,10 @@ public class ItsApiScheduler {
|
|
|
@Async
|
|
@Async
|
|
|
@Scheduled(cron = "0 * * * * *") // 1분 주기 작업 실행
|
|
@Scheduled(cron = "0 * * * * *") // 1분 주기 작업 실행
|
|
|
public void jobCctvPsetScnr() {
|
|
public void jobCctvPsetScnr() {
|
|
|
|
|
+ if (!this.processConfig.isStartSchedule()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (this.jobConfig.isCctvPreset()) {
|
|
if (this.jobConfig.isCctvPreset()) {
|
|
|
this.cctvPsetScnrThread.run();
|
|
this.cctvPsetScnrThread.run();
|
|
|
}
|
|
}
|
|
@@ -45,7 +52,11 @@ public class ItsApiScheduler {
|
|
|
@Async
|
|
@Async
|
|
|
@Scheduled(cron = "5 * * * * *") // 60초 주기 작업 실행
|
|
@Scheduled(cron = "5 * * * * *") // 60초 주기 작업 실행
|
|
|
public void pollingBaseDbms() {
|
|
public void pollingBaseDbms() {
|
|
|
- if (this.jobConfig.isBaseDbms()) {
|
|
|
|
|
|
|
+ if (!this.processConfig.isStartSchedule()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.jobConfig.isBaseDbms()) {
|
|
|
this.baseDbmsJobThread.run();
|
|
this.baseDbmsJobThread.run();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -56,6 +67,10 @@ public class ItsApiScheduler {
|
|
|
@Async
|
|
@Async
|
|
|
@Scheduled(cron = "20 * * * * *") // 60초 주기 작업 실행
|
|
@Scheduled(cron = "20 * * * * *") // 60초 주기 작업 실행
|
|
|
public void pollingUnitStts() {
|
|
public void pollingUnitStts() {
|
|
|
|
|
+ if (!this.processConfig.isStartSchedule()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (this.jobConfig.isUnitStts()) {
|
|
if (this.jobConfig.isUnitStts()) {
|
|
|
this.unitSttsJobThread.run();
|
|
this.unitSttsJobThread.run();
|
|
|
}
|
|
}
|
|
@@ -67,6 +82,10 @@ public class ItsApiScheduler {
|
|
|
@Async
|
|
@Async
|
|
|
@Scheduled(cron = "25 * * * * *") // 60초 주기 작업 실행
|
|
@Scheduled(cron = "25 * * * * *") // 60초 주기 작업 실행
|
|
|
public void pollingFcltStts() {
|
|
public void pollingFcltStts() {
|
|
|
|
|
+ if (!this.processConfig.isStartSchedule()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (this.jobConfig.isFcltStts()) {
|
|
if (this.jobConfig.isFcltStts()) {
|
|
|
this.fcltSttsJobThread.run();
|
|
this.fcltSttsJobThread.run();
|
|
|
}
|
|
}
|
|
@@ -76,11 +95,15 @@ public class ItsApiScheduler {
|
|
|
* DB Server Stts Update
|
|
* DB Server Stts Update
|
|
|
*/
|
|
*/
|
|
|
@Async
|
|
@Async
|
|
|
- @Scheduled(cron = "40 0/10 * * * *") // 5분 주기 작업 실행
|
|
|
|
|
|
|
+ @Scheduled(cron = "40 0/10 * * * *") // 10분 주기 작업 실행
|
|
|
public void jobDbSvrStts() {
|
|
public void jobDbSvrStts() {
|
|
|
- if (this.jobConfig.isDbSvrStts()) {
|
|
|
|
|
- this.dbSvrSttsJobThread.run();
|
|
|
|
|
|
|
+ if (!this.processConfig.isStartSchedule()) {
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+ this.dbmsSttsJobThread.run();
|
|
|
|
|
+// if (this.jobConfig.isDbSvrStts()) {
|
|
|
|
|
+// this.dbSvrSttsJobThread.run();
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*@Async
|
|
/*@Async
|