You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tiagodolphine (via GitHub)" <gi...@apache.org> on 2023/09/29 12:03:24 UTC
[GitHub] [incubator-kie-kogito-apps] tiagodolphine commented on a diff in pull request #1888: [KOGITO-9842] The initial load job task from DB is not executed Job Service
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org