From 38e7367be026e5a2d8704d0ccd7fffe620e4d828 Mon Sep 17 00:00:00 2001 From: Chris Wiechmann Date: Fri, 14 Jan 2022 14:05:36 +0100 Subject: [PATCH] More logging around caching --- .../com/axway/apim/adapter/apis/APIManagerAPIAdapter.java | 6 +++++- .../com/axway/apim/adapter/apis/APIManagerQuotaAdapter.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java b/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java index 17d8eab86..c654a2ee1 100644 --- a/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java +++ b/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerAPIAdapter.java @@ -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); diff --git a/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerQuotaAdapter.java b/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerQuotaAdapter.java index ec0e73875..8db507152 100644 --- a/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerQuotaAdapter.java +++ b/modules/apim-adapter/src/main/java/com/axway/apim/adapter/apis/APIManagerQuotaAdapter.java @@ -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; }