Skip to content

Commit

Permalink
Merge pull request #1260 from ohksj77/handle-misfired-trigger-exception
Browse files Browse the repository at this point in the history
Handle exceptions thrown while retrieving the misfired triggers
  • Loading branch information
jhouserizer authored Nov 12, 2024
2 parents 84204e6 + f31d0c8 commit cbe23a1
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -966,16 +966,25 @@ conn, STATE_WAITING, getMisfireTime(),
}

for (TriggerKey triggerKey: misfiredTriggers) {

OperableTrigger trig =
retrieveTrigger(conn, triggerKey);
OperableTrigger trig;

if (trig == null) {
try {
trig = retrieveTrigger(conn, triggerKey);
} catch (Exception e) {
getLog().error("Error retrieving the misfired trigger: {}", triggerKey, e);
continue;
}

doUpdateOfMisfiredTrigger(conn, trig, false, STATE_WAITING, recovering);
if (trig == null) {
continue;
}

try {
doUpdateOfMisfiredTrigger(conn, trig, false, STATE_WAITING, recovering);
} catch (Exception e) {
getLog().error("Error updating misfired trigger: {}", trig.getKey(), e);
continue;
}
if(trig.getNextFireTime() != null && trig.getNextFireTime().getTime() < earliestNewTime)
earliestNewTime = trig.getNextFireTime().getTime();
}
Expand Down

0 comments on commit cbe23a1

Please sign in to comment.