remove containers stopped just after creation from the containers log table
@@ -295,14 +295,18 @@ private void computeAndApplyChargeInt(
chargeProjectDailyCost(chargedProjectsDailyCost, projectName,
user, curentDay, charge);
}
- } else if (checkpoint == containerLog.getStart() && containerLog.
- getExitstatus() == ContainerExitStatus.CONTAINER_RUNNING_STATE) {
+ } else if (checkpoint == containerLog.getStart()){
+ if (containerLog.getExitstatus() == ContainerExitStatus.CONTAINER_RUNNING_STATE) {
//create a checkPoint at start to store multiplicator.
ContainerCheckPoint newCheckpoint = new ContainerCheckPoint(
containerLog.getContainerid(), containerLog.getStart(),
currentMultiplicator);
containersCheckPoints.put(containerLog.getContainerid(), newCheckpoint);
toBePercistedContainerCheckPoint.add(newCheckpoint);
+ } else {
+ //the container is not running remove it from db
+ toBeRemovedContainersLogs.add((ContainerLog) containerLog);
+ }
}
}
// Delet the finished ContainersLogs
