public boolean hasFailure() { for (JobActionResult result : results) { if (result.hasFailure()) { return true; } } return false; } }
public boolean hasFailure() { for (JobActionResult result : results) { if (result.hasFailure()) { return true; } } return false; } }
public void addResult(JobActionResult result) { this.results.add(result); this.updatedAt = ZonedDateTime.now(); long duration = getUpdatedAt().toInstant().getEpochSecond() - getCreatedAt().toInstant().getEpochSecond(); if (result.hasFailure()) { this.summary = String.format("Action %s of %s failed (%s seconds)", this.results.size(), actionCount, duration); } else { this.summary = String.format("Processed %s of %s actions (%s seconds)", this.results.size(), actionCount, duration); } }
private JobExecutionRequest executeJob(Application app, JobExecutionRequestEntity request, JobDefinitionEntity jobDefinitionEntity) throws Exception { for (JobAction action : jobDefinitionEntity.getJobActions()) { JobActionResult result; if (action.getLock() == null) { result = processAction(app, request, action); } else { log.info(String.format("Locking action %s for request %s", action.getLabel(), request.getJobExecutionRequestId())); synchronized (action.getLock().intern()) { result = processAction(app, request, action); } } if (result.hasFailure()) { break; } } // One last update to make sure everything is current. jobExecutionRequestStore.update(request); return request.toJobExecutionRequest(); }
private JobExecutionRequest executeJob(Application app, JobExecutionRequestEntity request, JobDefinitionEntity jobDefinitionEntity) throws Exception { for (JobAction action : jobDefinitionEntity.getJobActions()) { JobActionResult result; if (action.getLock() == null) { result = processAction(app, request, action); } else { log.info(String.format("Locking action %s for request %s", action.getLabel(), request.getJobExecutionRequestId())); synchronized (action.getLock().intern()) { result = processAction(app, request, action); } } if (result.hasFailure()) { break; } } // One last update to make sure everything is current. jobExecutionRequestStore.update(request); return request.toJobExecutionRequest(); }