Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(jobrunr): upgrade to 7.2.2 #516

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<usertype-core.version>7.0.0.CR1</usertype-core.version>
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<pf4j-spring.version>0.9.0</pf4j-spring.version>
<jobrunr.version>5.3.3</jobrunr.version>
<jobrunr.version>7.2.2</jobrunr.version>
<pf4j.version>3.12.0</pf4j.version>
<git.user />
<git.password />
Expand Down Expand Up @@ -95,7 +95,7 @@
</dependency>
<dependency>
<groupId>org.jobrunr</groupId>
<artifactId>jobrunr-spring-boot-starter</artifactId>
<artifactId>jobrunr-spring-boot-3-starter</artifactId>
<version>${jobrunr.version}</version>
<exclusions>
<exclusion>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fr/icdc/ebad/service/BatchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -254,7 +255,7 @@ public void deleteBatch(Long id) {
public void deleteScheduledJobFromBatch(Long batchId){
List<Scheduling> schedulings = schedulingRepository.findAllByBatchId(batchId);
schedulings.forEach(scheduling -> {
jobScheduler.delete(String.valueOf(scheduling.getId()));
jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId()));
schedulingRepository.delete(scheduling);
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fr/icdc/ebad/service/EnvironnementService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -154,7 +155,7 @@ public String getEspaceDisque(Long id) {
public void deleteScheduledJobFromEnvironment(Long environmentId){
List<Scheduling> schedulings = schedulingRepository.findAllByEnvironnementId(environmentId);
schedulings.forEach(scheduling -> {
jobScheduler.delete(String.valueOf(scheduling.getId()));
jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId()));
schedulingRepository.delete(scheduling);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/icdc/ebad/service/SchedulingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/fr/icdc/ebad/service/BatchServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void removeBatchsWithoutEnvironnement() {
verify(logBatchRepository).deleteAllByBatchId(eq(1L));
verify(logBatchRepository).deleteAllByBatchId(eq(2L));

verify(jobScheduler, times(1)).delete(eq("10"));
verify(jobScheduler, times(1)).deleteRecurringJob(eq("10"));
verify(schedulingRepository, times(1)).delete(eq(scheduling));

verify(batchRepository).delete(batch1);
Expand Down Expand Up @@ -440,7 +440,7 @@ public void testDeleteBatchById() {
batchService.deleteBatch(1L);
verify(logBatchRepository).deleteAllByBatchId(1L);
verify(batchRepository).deleteById(1L);
verify(jobScheduler, times(1)).delete(eq("10"));
verify(jobScheduler, times(1)).deleteRecurringJob(eq("10"));
verify(schedulingRepository, times(1)).delete(eq(scheduling));

}
Expand All @@ -459,7 +459,7 @@ public void deleteBatch() {

verify(logBatchRepository).deleteAllByBatchId(1L);
verify(batchRepository).deleteById(1L);
verify(jobScheduler, times(1)).delete(eq("10"));
verify(jobScheduler, times(1)).deleteRecurringJob(eq("10"));
verify(schedulingRepository, times(1)).delete(eq(scheduling));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void deleteEnvironnement() {
verify(batchRepository, times(1)).deleteAll(eq(environnement.getBatchs()));
verify(directoryRepository, times(1)).deleteByEnvironnement(eq(environnement));
verify(environnementRepository, times(1)).delete(eq(environnement));
verify(jobScheduler, times(1)).delete(eq("10"));
verify(jobScheduler, times(1)).deleteRecurringJob(eq("10"));
verify(schedulingRepository, times(1)).delete(eq(scheduling));
}

Expand Down Expand Up @@ -204,7 +204,7 @@ public void deleteEnvironnement2() {
verify(batchRepository, times(0)).deleteAll(eq(environnement.getBatchs()));
verify(directoryRepository, times(1)).deleteByEnvironnement(eq(environnement));
verify(environnementRepository, times(1)).delete(eq(environnement));
verify(jobScheduler, times(1)).delete(eq("10"));
verify(jobScheduler, times(1)).deleteRecurringJob(eq("10"));
verify(schedulingRepository, times(1)).delete(eq(scheduling));

}
Expand Down
Loading