Skip to content

Commit

Permalink
More logging around caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Wiechmann committed Jan 14, 2022
1 parent 422ce3d commit 38e7367
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,11 @@ private void addQuotaConfiguration(API api, boolean addQuota) throws AppExceptio
private void addExistingClientAppQuotas(API api, boolean addQuota) throws AppException {
if(!addQuota || !APIManagerAdapter.hasAdminAccount()) return;
if(api.getApplications()==null || api.getApplications().size()==0) return;
LOG.debug("Loading application quota for " + api.getApplications().size()+ " subscribed applications.");
if(api.getApplications().size()>1000) {
LOG.info("Loading application quotas for " + api.getApplications().size()+ " subscribed applications. This might take a few minutes ...");
} else {
LOG.info("Loading application quotas for " + api.getApplications().size()+ " subscribed applications.");
}
for(ClientApplication app : api.getApplications()) {
APIQuota appQuota = APIManagerAdapter.getInstance().quotaAdapter.getQuota(app.getId(), null, true, true);
app.setAppQuota(appQuota);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private void readQuotaFromAPIManager(String quotaId) throws AppException {
uri = new URIBuilder(cmd.getAPIManagerURL()).setPath(cmd.getApiBasepath() + "/quotas/"+quotaId).build();
} else {
if(applicationsQuotaCache.containsKey(quotaId)) {
LOG.debug("Found quota with ID: " + quotaId + " in cache: " + applicationsQuotaCache.get(quotaId));
this.apiManagerResponse.put(quotaId, applicationsQuotaCache.get(quotaId));
return;
}
Expand Down

0 comments on commit 38e7367

Please sign in to comment.