tiagodolphine commented on code in PR #1888:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/1888#discussion_r1341284130


##########
jobs-service/jobs-service-common/src/main/java/org/kie/kogito/jobs/service/scheduler/JobSchedulerManager.java:
##########
@@ -93,6 +93,8 @@ void onStartup(@Observes 
@Priority(Interceptor.Priority.PLATFORM_AFTER) StartupE
 
     protected void onMessagingStatusChange(@Observes MessagingChangeEvent 
event) {
         this.enabled.set(event.isEnabled());
+        //run load jobs once the instance become a leader to avoid waiting for 
the next periodic run
+        vertx.runOnContext(this::loadJobDetails);

Review Comment:
   There should be no issue running more than once loadJobDetails, there is a 
check in the method to avoid scheduling the same job multiple times with a 
ConcurrentMap. Still, I agree with your point, and this can be improved, let me 
think a bit and send an update to the PR to improve this process. Thanks for 
bringing up this point!
   
   
https://github.com/apache/incubator-kie-kogito-apps/blob/a9f5d1cb4bb0759ef63facd2b81c8c79da373a18/jobs-service/jobs-service-common/src/main/java/org/kie/kogito/jobs/service/scheduler/JobSchedulerManager.java#L105C1-L106C1
   
   
https://github.com/apache/incubator-kie-kogito-apps/blob/a9f5d1cb4bb0759ef63facd2b81c8c79da373a18/jobs-service/jobs-service-common/src/main/java/org/kie/kogito/jobs/service/scheduler/BaseTimerJobScheduler.java#L89C1-L90C1



-- 
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