|
From: Tomas G. <to...@pr...> - 2019-08-09 09:14:18
|
Hi Jaime, I committed your patch, a slightly modified version under the jira issue: https://jira.primekey.se/browse/ECA-8412 Regards, Tomas On 2019-08-05 13:07, Tomas Gustavsson wrote: > Hi Jaime, > > Nice find, thanks. > > The logging got a bit misplaced in r32446 and a bit more cleanup was > needed I think. How about this patch, making the returns more structured? > > Can you create an issue in Jira for this? > > Regards, > Tomas > > > On 2019-07-26 02:25, Jaime Hablutzel wrote: >> PublishQueueProcessWorker is currently always reporting a NO_ACTION >> result, even when there are successes or failures. Patch follows: >> >> --- >> modules/ejbca-common-web/src/org/ejbca/core/model/services/workers/PublishQueueProcessWorker.java >> (revision 32884) >> +++ >> modules/ejbca-common-web/src/org/ejbca/core/model/services/workers/PublishQueueProcessWorker.java >> (date 1564026429457) >> @@ -111,7 +111,7 @@ >> int publisherId = Integer.valueOf(ids[i]); >> // Get everything from the queue for this >> publisher id >> BasePublisher publisher = >> publisherSession.getPublisher(publisherId); >> - >> publisherQueueSession.plainFifoTryAlwaysLimit100EntriesOrderByTimeCreated(getAdmin(), >> publisher); >> + >> publishingResult.append(publisherQueueSession.plainFifoTryAlwaysLimit100EntriesOrderByTimeCreated(getAdmin(), >> publisher)); >> } >> } else { >> log.debug("No publisher ids configured for worker."); >> @@ -121,23 +121,25 @@ >> runmap.put(this.serviceName, Boolean.FALSE); >> } >> } >> - } else { >> - log.info >> <http://log.info>(InternalEjbcaResources.getInstance().getLocalizedMessage("services.alreadyrunninginvm", >> PublishQueueProcessWorker.class.getName())); >> - } >> - log.trace("<work"); >> - if (publishingResult.getSuccesses() == 0 && >> publishingResult.getFailures() == 0) { >> - return new ServiceExecutionResult(Result.NO_ACTION, >> - "Publishing Queue Service " + serviceName + " ran, >> but the publishing queue was either empty or the publisher(s) could not >> connect."); >> - } else { >> - if (publishingResult.getFailures() != 0) { >> - return new ServiceExecutionResult(Result.FAILURE, >> - "Publishing Queue Service " + serviceName + " >> ran with " + publishingResult.getFailures() + " failed publishing >> operations" >> - + (publishingResult.getSuccesses() == 0 >> ? "." >> - : " and " + >> publishingResult.getSuccesses() + " successful publishing operations.")); >> - } else { >> - return new ServiceExecutionResult(Result.SUCCESS, >> "Publishing Queue Service " + serviceName + " ran with " >> - + publishingResult.getSuccesses() + " >> successful publishing operations."); >> + log.trace("<work"); >> + if (publishingResult.getSuccesses() == 0 && >> publishingResult.getFailures() == 0) { >> + return new ServiceExecutionResult(Result.NO_ACTION, >> + "Publishing Queue Service " + serviceName + " >> ran, but the publishing queue was either empty or the publisher(s) could >> not connect."); >> + } else { >> + if (publishingResult.getFailures() != 0) { >> + return new ServiceExecutionResult(Result.FAILURE, >> + "Publishing Queue Service " + serviceName + >> " ran with " + publishingResult.getFailures() + " failed publishing >> operations" >> + + (publishingResult.getSuccesses() >> == 0 ? "." >> + : " and " + >> publishingResult.getSuccesses() + " successful publishing operations.")); >> + } else { >> + return new ServiceExecutionResult(Result.SUCCESS, >> "Publishing Queue Service " + serviceName + " ran with " >> + + publishingResult.getSuccesses() + " >> successful publishing operations."); >> + } >> } >> + } else { >> + String msg = >> InternalEjbcaResources.getInstance().getLocalizedMessage("services.alreadyrunninginvm", >> PublishQueueProcessWorker.class.getName()); >> + log.info <http://log.info>(msg); >> + return new ServiceExecutionResult(Result.NO_ACTION, msg); >> } >> } >> >> -- >> Jaime Hablutzel - +51 994690880 >> >> >> _______________________________________________ >> Ejbca-develop mailing list >> Ejb...@li... >> https://lists.sourceforge.net/lists/listinfo/ejbca-develop >> >> >> >> _______________________________________________ >> Ejbca-develop mailing list >> Ejb...@li... >> https://lists.sourceforge.net/lists/listinfo/ejbca-develop |