Skip to content

Commit

Permalink
fix(quartz): ensure that invoker is properly initialized in QuartzJob…
Browse files Browse the repository at this point in the history
…Definition#schedule

(cherry picked from commit e29869d)
  • Loading branch information
machi1990 authored and gsmet committed May 23, 2023
1 parent eef9bc5 commit c8d802b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ public boolean isBlocking() {
Optional<TriggerBuilder<?>> triggerBuilder = createTrigger(identity, scheduled, cronType, runtimeConfig, jobDetail);

if (triggerBuilder.isPresent()) {
invoker = SimpleScheduler.initInvoker(invoker, skippedExecutionEvent, successExecutionEvent,
failedExecutionEvent, concurrentExecution, skipPredicate);
org.quartz.Trigger trigger = triggerBuilder.get().build();
QuartzTrigger existing = scheduledTasks.putIfAbsent(identity, new QuartzTrigger(trigger.getKey(),
new Function<>() {
Expand All @@ -826,8 +828,6 @@ public org.quartz.Trigger apply(TriggerKey triggerKey) {
throw new IllegalStateException("A job with this identity is already scheduled: " + identity);
}

invoker = SimpleScheduler.initInvoker(invoker, skippedExecutionEvent, successExecutionEvent,
failedExecutionEvent, concurrentExecution, skipPredicate);
try {
scheduler.scheduleJob(jobDetail, trigger);
} catch (SchedulerException e) {
Expand Down

0 comments on commit c8d802b

Please sign in to comment.