diff --git a/src/main/java/com/postgraduate/batch/scheduler/JobSchedulerConfig.java b/src/main/java/com/postgraduate/batch/scheduler/JobSchedulerConfig.java index 45404e7a..ce28bc5d 100644 --- a/src/main/java/com/postgraduate/batch/scheduler/JobSchedulerConfig.java +++ b/src/main/java/com/postgraduate/batch/scheduler/JobSchedulerConfig.java @@ -61,7 +61,7 @@ public void launchSalaryJob() throws JobInstanceAlreadyCompleteException, JobExe .addLocalDateTime("date", LocalDateTime.now()) .toJobParameters(); jobLauncher.run(salaryJob, jobParameters); - checkSalaryJobSuccess(jobParameters); + checkSalaryJobSuccess(); } public void launchSalaryJobWithAdmin() throws JobInstanceAlreadyCompleteException, JobExecutionAlreadyRunningException, JobParametersInvalidException, JobRestartException { @@ -69,10 +69,10 @@ public void launchSalaryJobWithAdmin() throws JobInstanceAlreadyCompleteExceptio .addLocalDateTime("date", LocalDateTime.now()) .toJobParameters(); jobLauncher.run(salaryJobWithAdmin, jobParameters); - checkSalaryJobSuccess(jobParameters); + checkSalaryJobSuccess(); } - private void checkSalaryJobSuccess(JobParameters jobParameters) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException { + private void checkSalaryJobSuccess() throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException { int retries = 0; boolean success = false; int seniorSize = seniorGetService.allSeniorId() @@ -90,6 +90,9 @@ private void checkSalaryJobSuccess(JobParameters jobParameters) throws JobExecut Thread.currentThread().interrupt(); //스레드 상태 복원 log.error("Thread Interrupt 발생"); } + JobParameters jobParameters = new JobParametersBuilder() + .addLocalDateTime("date", LocalDateTime.now()) + .toJobParameters(); jobLauncher.run(salaryJobWithAdmin, jobParameters); retries++; }