Merge pull request #10907 from rdehuyss/master

Update to JobRunr 3.1
This commit is contained in:
Loredana Crusoveanu 2021-06-15 08:22:39 +03:00 committed by GitHub
commit 071dae8feb
3 changed files with 3 additions and 3 deletions

View File

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

View File

@ -32,6 +32,6 @@ public class JobRunrSpringBootApp {
@PostConstruct @PostConstruct
public void scheduleRecurrently() { 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( public ResponseEntity<String> schedule(
@PathVariable("input") @DefaultValue("default-input") String input, @PathVariable("input") @DefaultValue("default-input") String input,
@RequestParam("scheduleAt") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime scheduleAt) { @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"); return okResponse("job scheduled successfully");
} }