galovics commented on code in PR #2385:
URL: https://github.com/apache/fineract/pull/2385#discussion_r908323256


##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/service/JobRegisterServiceImpl.java:
##########
@@ -98,7 +98,7 @@ public class JobRegisterServiceImpl implements 
JobRegisterService, ApplicationLi
     @PostConstruct
     public void loadAllJobs() {
         // If the instance is not Batch Enabled will not load the Jobs
-        if (!fineractProperties.getMode().isBatchEnabled()) {
+        if (!(fineractProperties.getMode().isBatchWorkerEnabled() || 
fineractProperties.getMode().isBatchManagerEnabled())) {

Review Comment:
   Only the batch manager here too.



##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/jobs/api/SchedulerJobApiResource.java:
##########
@@ -133,7 +133,7 @@ public Response 
executeJob(@PathParam(SchedulerJobApiConstants.JOB_ID) @Paramete
             @QueryParam(SchedulerJobApiConstants.COMMAND) 
@Parameter(description = "command") final String commandParam) {
         // check the logged in user have permissions to execute scheduler jobs
         Response response;
-        if (fineractProperties.getMode().isBatchEnabled()) {
+        if (fineractProperties.getMode().isBatchWorkerEnabled() || 
fineractProperties.getMode().isBatchManagerEnabled()) {

Review Comment:
   Only the batch manager, not the workers.



##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/instancemode/filter/FineractInstanceModeApiFilter.java:
##########
@@ -44,7 +44,7 @@
 public class FineractInstanceModeApiFilter extends OncePerRequestFilter {
 
     private static final List<ExceptionListItem> EXCEPTION_LIST = List.of(
-            item(FineractProperties.FineractModeProperties::isBatchEnabled, pi 
-> pi.startsWith("/jobs")),
+            
item(FineractProperties.FineractModeProperties::isBatchWorkerEnabled, pi -> 
pi.startsWith("/jobs")),

Review Comment:
   Only the batch manager should allow the /jobs APIs, not the workers. :-)



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

Reply via email to