Skip to content

Commit

Permalink
Issue #112
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-stastny committed Jul 29, 2014
1 parent 0b0f1c3 commit 2704556
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public int getVal() {
*/
public static BatchStates calculateBatchState(List<States> childStates) {
// ve stavu planned nebo running
if (States.one(childStates, States.FAILED)) {
if (States.one(childStates, States.FAILED, States.KILLED)) {
return BATCH_FAILED;
} else if (States.one(childStates,States.WARNING)) {
return BATCH_WARNING;
Expand Down
15 changes: 15 additions & 0 deletions search/src/java/cz/incad/Kramerius/LongRunningProcessServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,21 @@ public void doAction(ServletContext context, HttpServletRequest req, HttpServlet
String uuid = req.getParameter("uuid");
String realPath = context.getRealPath("WEB-INF/lib");
LRProcess oProcess = stopOldProcess(realPath, uuid, defManager, lrProcessManager);

// update parent process
List<LRProcess> processes = lrProcessManager.getLongRunningProcessesByGroupToken(oProcess.getGroupToken());
if (processes.size() > 1) {
LOGGER.fine("calculating new master state");
List<States> childStates = new ArrayList<States>();
for (int i = 0, ll = processes.size(); i < ll; i++) {
childStates.add(processes.get(i).getProcessState());
}
processes.get(0).setBatchState(BatchStates.calculateBatchState(childStates));
LOGGER.fine("calculated state '"+processes.get(0)+"'");
lrProcessManager.updateLongRunninngProcessBatchState(processes.get(0));
}


StringBuffer buffer = new StringBuffer();
buffer.append("<html><body>");
buffer.append("<ul>");
Expand Down

0 comments on commit 2704556

Please sign in to comment.