change log warning to info on error fetching from price provider
This commit is contained in:
parent
5db80eac17
commit
a8114e147d
@ -202,8 +202,8 @@ public class PriceFeedService {
|
|||||||
String baseUrlOfFaultyRequest = ((PriceRequestException) throwable).priceProviderBaseUrl;
|
String baseUrlOfFaultyRequest = ((PriceRequestException) throwable).priceProviderBaseUrl;
|
||||||
String baseUrlOfCurrentRequest = priceProvider.getBaseUrl();
|
String baseUrlOfCurrentRequest = priceProvider.getBaseUrl();
|
||||||
if (baseUrlOfCurrentRequest.equals(baseUrlOfFaultyRequest)) {
|
if (baseUrlOfCurrentRequest.equals(baseUrlOfFaultyRequest)) {
|
||||||
log.warn("We received an error: baseUrlOfCurrentRequest={}, baseUrlOfFaultyRequest={}, error={}",
|
log.info("We received an error requesting prices: baseUrlOfFaultyRequest={}, error={}",
|
||||||
baseUrlOfCurrentRequest, baseUrlOfFaultyRequest, throwable.toString());
|
baseUrlOfFaultyRequest, throwable.toString());
|
||||||
retryWithNewProvider();
|
retryWithNewProvider();
|
||||||
} else {
|
} else {
|
||||||
log.debug("We received an error from an earlier request. We have started a new request already so we ignore that error. " +
|
log.debug("We received an error from an earlier request. We have started a new request already so we ignore that error. " +
|
||||||
@ -242,6 +242,7 @@ public class PriceFeedService {
|
|||||||
String oldBaseUrl = priceProvider.getBaseUrl();
|
String oldBaseUrl = priceProvider.getBaseUrl();
|
||||||
boolean looped = setNewPriceProvider();
|
boolean looped = setNewPriceProvider();
|
||||||
if (looped) {
|
if (looped) {
|
||||||
|
log.warn("Exhausted price provider list, looping to beginning");
|
||||||
if (System.currentTimeMillis() - lastLoopTs < PERIOD_SEC * 1000) {
|
if (System.currentTimeMillis() - lastLoopTs < PERIOD_SEC * 1000) {
|
||||||
retryDelay = Math.min(retryDelay + 5, PERIOD_SEC);
|
retryDelay = Math.min(retryDelay + 5, PERIOD_SEC);
|
||||||
} else {
|
} else {
|
||||||
@ -250,11 +251,10 @@ public class PriceFeedService {
|
|||||||
lastLoopTs = System.currentTimeMillis();
|
lastLoopTs = System.currentTimeMillis();
|
||||||
thisRetryDelay = retryDelay;
|
thisRetryDelay = retryDelay;
|
||||||
}
|
}
|
||||||
log.warn("We received an error at the request from provider {}. " +
|
log.info("We received an error at the request from provider {}. " +
|
||||||
"We select the new provider {} and use that for a new request in {} sec.", oldBaseUrl, priceProvider.getBaseUrl(), thisRetryDelay);
|
"We select the new provider {} and use that for a new request in {} sec.", oldBaseUrl, priceProvider.getBaseUrl(), thisRetryDelay);
|
||||||
if (thisRetryDelay > 0) {
|
if (thisRetryDelay > 0) {
|
||||||
UserThread.runAfter(() -> {
|
UserThread.runAfter(() -> {
|
||||||
log.warn("Running request!");
|
|
||||||
request(true);
|
request(true);
|
||||||
}, thisRetryDelay);
|
}, thisRetryDelay);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user