martinweiler commented on code in PR #2214:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/2214#discussion_r2093571100


##########
jobs-service/jobs-service-common/src/main/java/org/kie/kogito/jobs/service/scheduler/impl/VertxTimerServiceScheduler.java:
##########
@@ -105,19 +115,30 @@ public boolean removeJob(ManageableJobHandle jobHandle) {
 
     @Override
     public void internalSchedule(TimerJobInstance timerJobInstance) {
-        final Trigger trigger = timerJobInstance.getTrigger();
+        Trigger trigger = timerJobInstance.getTrigger();
         if (trigger.hasNextFireTime() == null) {
             return;
         }
-        final long then = trigger.hasNextFireTime().getTime();
-        final ZonedDateTime now = DateUtil.now();
-        final long delay = calculateDelay(then, now);
-        final ManageableJobHandle handle = (ManageableJobHandle) 
timerJobInstance.getJobHandle();
-        long scheduledId = vertx.setTimer(delay, i -> 
timerJobInstance.getJob().execute(timerJobInstance.getJobContext()));
+        long then = trigger.hasNextFireTime().getTime();
+        ZonedDateTime now = DateUtil.now();
+        long delay = calculateDelay(then, now);
+        ManageableJobHandle handle = (ManageableJobHandle) 
timerJobInstance.getJobHandle();
+
+        long scheduledId = vertx.setTimer(delay, execute(timerJobInstance));
         handle.setId(scheduledId);
         handle.setScheduledTime(now);
     }
 
+    private Handler<Long> execute(TimerJobInstance timerJobInstance) {
+        return timerId -> {
+            LOGGER.info("executing timeout {} for {}", timerId, 
timerJobInstance);

Review Comment:
   Please change to `debug` to minimize logging at runtime



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to