Skip to content

Commit

Permalink
[HOPS-1638] fix quota daily cost
Browse files Browse the repository at this point in the history
  • Loading branch information
berthoug committed Jun 21, 2021
1 parent d9e33af commit cdff810
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private void computeAndApplyChargeInt(ContainerId containerId, Map<String, Long>
float charge = computeCharge(resourcesMap, usedMillis);
chargeProjectQuota(projectQuota, projectName, user, containerId, charge);
//** ProjectDailyCost charging**
chargeProjectDailyCost(projectDailyCost, projectName, user, curentDay, charge, appId);
projectDailyCost = chargeProjectDailyCost(projectDailyCost, projectName, user, curentDay, charge, appId);
if (projectQuota != null) {
pqDA.add(projectQuota);
}
Expand Down Expand Up @@ -352,7 +352,7 @@ private void chargeProjectQuota(ProjectQuota projectQuota, String projectName, S
}
}

private void chargeProjectDailyCost(ProjectDailyCost projectDailyCost, String projectName, String user, long day,
private ProjectDailyCost chargeProjectDailyCost(ProjectDailyCost projectDailyCost, String projectName, String user, long day,
float charge, ApplicationId appId) {

LOG.debug("Quota: project " + projectName + " user " + user + " has used " + charge + " credits, on day: " + day);
Expand All @@ -362,6 +362,7 @@ private void chargeProjectDailyCost(ProjectDailyCost projectDailyCost, String pr
}

projectDailyCost.incrementCharge(charge, appId.toString());
return projectDailyCost;
}

/**
Expand Down

0 comments on commit cdff810

Please sign in to comment.