From 3204491cd0f3607ceb4fb4e04acfe7a7b32939ef Mon Sep 17 00:00:00 2001 From: cha Date: Thu, 19 Jun 2025 09:57:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=B0=EC=B9=98=20=EC=8A=A4=EC=BC=80?= =?UTF-8?q?=EC=A5=B4=20=EC=88=98=EC=A0=95=20(yml)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qcast/batch/JobLauncherController.java | 57 ++++++++----------- src/main/resources/config/application-dev.yml | 3 - .../resources/config/application-local.yml | 3 - src/main/resources/config/application-prd.yml | 6 +- src/main/resources/config/application.yml | 3 - 5 files changed, 25 insertions(+), 47 deletions(-) diff --git a/src/main/java/com/interplug/qcast/batch/JobLauncherController.java b/src/main/java/com/interplug/qcast/batch/JobLauncherController.java index b175df11..6d4e7825 100644 --- a/src/main/java/com/interplug/qcast/batch/JobLauncherController.java +++ b/src/main/java/com/interplug/qcast/batch/JobLauncherController.java @@ -32,8 +32,8 @@ public class JobLauncherController { @Value("${qsp.master-admin-user-batch-url}") private String qspInterfaceUrl; - @Value("${batch.job.enabled}") - private boolean batchJobEnabled; + @Value("${spring.profiles.scheduler}") + private String scheduler; /** * 특정 Job을 매핑으로 실행하는 메소드 * @@ -118,12 +118,12 @@ public class JobLauncherController { if (job == null) { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - if (batchJobEnabled) { + jobLauncher.run(job, jobParameters); - } + } return "OK"; } @@ -147,13 +147,12 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; } @@ -177,13 +176,12 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; @@ -208,13 +206,11 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; @@ -239,13 +235,11 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; @@ -270,13 +264,11 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; @@ -301,7 +293,7 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); @@ -328,13 +320,11 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; @@ -359,13 +349,13 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - if (batchJobEnabled) { + jobLauncher.run(job, jobParameters); - } + } return "OK"; @@ -390,13 +380,12 @@ public class JobLauncherController { return "Job " + jobName + " not found"; } - if ("Y".equals(System.getProperty("spring.profiles.scheduler"))) { + if ("Y".equals(scheduler)) { JobParameters jobParameters = new JobParametersBuilder().addDate("time", new Date()).toJobParameters(); - if (batchJobEnabled) { jobLauncher.run(job, jobParameters); - } + } return "OK"; diff --git a/src/main/resources/config/application-dev.yml b/src/main/resources/config/application-dev.yml index 0bd61c41..d2a739a6 100644 --- a/src/main/resources/config/application-dev.yml +++ b/src/main/resources/config/application-dev.yml @@ -25,9 +25,6 @@ spring: enabled: false profiles: scheduler: Y -batch: - job: - enabled: true #QSP url 하나시스운영 #https://jp.qsalesplatform.com #QSP url 하나시스개발 #https://121.168.9.37:8080 #QSP url interplug dev #http://1.248.227.176:8120 diff --git a/src/main/resources/config/application-local.yml b/src/main/resources/config/application-local.yml index d70bbfa8..9ad0fe5e 100644 --- a/src/main/resources/config/application-local.yml +++ b/src/main/resources/config/application-local.yml @@ -25,9 +25,6 @@ spring: enabled: false profiles: scheduler: Y -batch: - job: - enabled: true #QSP qsp: url: http://1.248.227.176:8120 diff --git a/src/main/resources/config/application-prd.yml b/src/main/resources/config/application-prd.yml index e58a14b9..f36293ce 100644 --- a/src/main/resources/config/application-prd.yml +++ b/src/main/resources/config/application-prd.yml @@ -23,10 +23,8 @@ spring: names: ${job.name:NONE} enabled: false profiles: - scheduler: Y -batch: - job: - enabled: false + scheduler: N + #QSP url 하나시스운영 #https://jp.qsalesplatform.com #QSP url 하나시스개발 #http://121.168.9.37:8080 #QSP url interplug dev #http://1.248.227.176:8120 diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml index 078eabf1..de72cad3 100644 --- a/src/main/resources/config/application.yml +++ b/src/main/resources/config/application.yml @@ -52,9 +52,6 @@ management: health: enabled: true -batch: - job: - enabled: true file: root.path: /home/development/public/files