Update to JobRunr 3.1
This commit is contained in:
parent
f9c1cc4b96
commit
12e563e0b1
|
@ -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>
|
||||||
|
|
|
@ -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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue