dev #400
@ -39,6 +39,12 @@ public class JobLauncherController {
|
||||
@Value("${spring.profiles.scheduler}")
|
||||
private String scheduler;
|
||||
|
||||
@Value("${server.port:8080}")
|
||||
private int serverPort;
|
||||
|
||||
@Value("${batch.scheduler-port:8080}")
|
||||
private int schedulerPort;
|
||||
|
||||
/**
|
||||
* 서버 시작 시 실행 중(STARTED)인 상태로 남은 Job들을 FAILED 처리
|
||||
*/
|
||||
@ -253,6 +259,12 @@ public class JobLauncherController {
|
||||
* 공통 스케줄러 실행 메소드
|
||||
*/
|
||||
private String executeScheduledJob(String jobName) throws JobInstanceAlreadyCompleteException, JobExecutionAlreadyRunningException, JobParametersInvalidException, JobRestartException {
|
||||
// 스케줄러 전용 포트 인스턴스에서만 실행 (멀티 인스턴스 데드락 방지)
|
||||
if (serverPort != schedulerPort) {
|
||||
log.debug("스케줄러는 {} 포트 인스턴스에서만 실행됩니다. 현재 포트: {}, Job: {} 스킵", schedulerPort, serverPort, jobName);
|
||||
return "Scheduler runs only on port " + schedulerPort + ". Current port: " + serverPort;
|
||||
}
|
||||
|
||||
Job job = jobs.get(jobName);
|
||||
if (job == null) {
|
||||
log.error("Job {} not found", jobName);
|
||||
|
||||
@ -25,6 +25,10 @@ spring:
|
||||
enabled: false
|
||||
profiles:
|
||||
scheduler: N
|
||||
|
||||
#batch
|
||||
batch:
|
||||
scheduler-port: 8090
|
||||
#QSP url 하나시스운영 #https://jp.qsalesplatform.com
|
||||
#QSP url 하나시스개발 #http://121.168.9.37:8080
|
||||
#QSP url interplug dev #http://1.248.227.176:8120
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user