Skip to content

Commit

Permalink
Handle exceptions thrown while retrieving the misfired trigger
Browse files Browse the repository at this point in the history
Signed-off-by: 김승진 <ohksj77@gmail.com>
  • Loading branch information
ohksj77 committed Nov 10, 2024
1 parent 33ef506 commit f31d0c8
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 f31d0c8

Please sign in to comment.