mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Adding logic to acknowledge 404 response when tiers not available
This commit is contained in:
parent
00d21fc2ff
commit
ef0023cf5d
@ -76,18 +76,18 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
|
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext()
|
||||||
.getTenantDomain();
|
.getTenantDomain();
|
||||||
String tiersLoadedForTenant = tiersMap.get(tenantDomain);
|
String tiersLoadedForTenant = tiersMap.get(tenantDomain);
|
||||||
|
|
||||||
if (tiersLoadedForTenant == null) {
|
if (tiersLoadedForTenant == null) {
|
||||||
int tierStatus = 0;
|
boolean tierLoaded = false;
|
||||||
int attempts = 0;
|
int attempts = 0;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
storeClient.getIndividualTier()
|
storeClient.getIndividualTier()
|
||||||
.tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, APP_TIER_TYPE,
|
.tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, APP_TIER_TYPE,
|
||||||
tenantDomain, CONTENT_TYPE, null, null);
|
tenantDomain, CONTENT_TYPE, null, null);
|
||||||
tiersMap.put(tenantDomain, "exist");
|
tiersMap.put(tenantDomain, "exist");
|
||||||
tierStatus = 200;
|
tierLoaded = true;
|
||||||
} catch (FeignException e) {
|
} catch (FeignException e) {
|
||||||
tierStatus = e.status();
|
|
||||||
attempts++;
|
attempts++;
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
@ -95,7 +95,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
log.warn("Interrupted the waiting for tier availability.");
|
log.warn("Interrupted the waiting for tier availability.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (tierStatus == 500 && attempts < MAX_ATTEMPTS);
|
} while ((!tierLoaded) && attempts < MAX_ATTEMPTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplicationList applicationList = storeClient.getApplications()
|
ApplicationList applicationList = storeClient.getApplications()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user