diff --git a/pom.xml b/pom.xml index 279cd47..b7ec6b4 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 7.0.0.CR1 ${project.build.directory}/test-results 0.9.0 - 5.3.3 + 7.2.2 3.12.0 @@ -95,7 +95,7 @@ org.jobrunr - jobrunr-spring-boot-starter + jobrunr-spring-boot-3-starter ${jobrunr.version} diff --git a/src/main/java/fr/icdc/ebad/service/BatchService.java b/src/main/java/fr/icdc/ebad/service/BatchService.java index 47b961d..dcb0ef9 100644 --- a/src/main/java/fr/icdc/ebad/service/BatchService.java +++ b/src/main/java/fr/icdc/ebad/service/BatchService.java @@ -14,6 +14,7 @@ import fr.icdc.ebad.repository.SchedulingRepository; import fr.icdc.ebad.security.SecurityUtils; import fr.icdc.ebad.service.util.EbadServiceException; +import org.jobrunr.jobs.JobId; import org.jobrunr.jobs.annotations.Job; import org.jobrunr.scheduling.JobScheduler; import org.slf4j.Logger; @@ -254,7 +255,7 @@ public void deleteBatch(Long id) { public void deleteScheduledJobFromBatch(Long batchId){ List schedulings = schedulingRepository.findAllByBatchId(batchId); schedulings.forEach(scheduling -> { - jobScheduler.delete(String.valueOf(scheduling.getId())); + jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId())); schedulingRepository.delete(scheduling); }); } diff --git a/src/main/java/fr/icdc/ebad/service/EnvironnementService.java b/src/main/java/fr/icdc/ebad/service/EnvironnementService.java index c2206ea..3625a92 100644 --- a/src/main/java/fr/icdc/ebad/service/EnvironnementService.java +++ b/src/main/java/fr/icdc/ebad/service/EnvironnementService.java @@ -24,6 +24,7 @@ import fr.icdc.ebad.service.util.EbadServiceException; import jakarta.annotation.Nullable; import jakarta.validation.constraints.NotNull; +import org.jobrunr.jobs.JobId; import org.jobrunr.scheduling.JobScheduler; import org.pf4j.PluginRuntimeException; import org.pf4j.PluginWrapper; @@ -154,7 +155,7 @@ public String getEspaceDisque(Long id) { public void deleteScheduledJobFromEnvironment(Long environmentId){ List schedulings = schedulingRepository.findAllByEnvironnementId(environmentId); schedulings.forEach(scheduling -> { - jobScheduler.delete(String.valueOf(scheduling.getId())); + jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId())); schedulingRepository.delete(scheduling); }); } diff --git a/src/main/java/fr/icdc/ebad/service/SchedulingService.java b/src/main/java/fr/icdc/ebad/service/SchedulingService.java index 3cd78b0..38c6be0 100644 --- a/src/main/java/fr/icdc/ebad/service/SchedulingService.java +++ b/src/main/java/fr/icdc/ebad/service/SchedulingService.java @@ -65,7 +65,7 @@ public Scheduling saveAndRun(Long batchId, Long environnementId, String paramete @Transactional public void remove(Long schedulingId) { Scheduling scheduling = schedulingRepository.getById(schedulingId); - jobScheduler.delete(String.valueOf(scheduling.getId())); + jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId())); schedulingRepository.delete(scheduling); }