Update to JobRunr 3.1

This commit is contained in:
Ronald Dehuysser 2021-06-14 17:36:26 +02:00
parent f9c1cc4b96
commit 12e563e0b1
3 changed files with 3 additions and 3 deletions

View File

@ -91,7 +91,7 @@
</build>
<properties>
<jobrunr.version>1.1.0</jobrunr.version>
<jobrunr.version>3.1.1</jobrunr.version>
<awaitility.version>4.0.3</awaitility.version>
<openapi-generator.version>5.1.0</openapi-generator.version>
<spring.data.version>2.4.5</spring.data.version>

View File

@ -32,6 +32,6 @@ public class JobRunrSpringBootApp {
@PostConstruct
public void scheduleRecurrently() {
jobScheduler.<SampleJobService>scheduleRecurrently(x -> x.executeSampleJob("a recurring job"), Cron.every5minutes());
jobScheduler.<SampleJobService>scheduleRecurrently(Cron.every5minutes(), x -> x.executeSampleJob("a recurring job"));
}
}

View File

@ -33,7 +33,7 @@ public class JobRunrController {
public ResponseEntity<String> schedule(
@PathVariable("input") @DefaultValue("default-input") String input,
@RequestParam("scheduleAt") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime scheduleAt) {
jobScheduler.schedule(() -> sampleJobService.executeSampleJob(input), scheduleAt);
jobScheduler.schedule(scheduleAt, () -> sampleJobService.executeSampleJob(input));
return okResponse("job scheduled successfully");
}