fetch prices on same thread if 0 delay

This commit is contained in:
woodser 2023-01-07 13:50:14 -05:00
parent 3e0473719b
commit 39f86817e0

View file

@ -252,9 +252,14 @@ public class PriceFeedService {
} }
log.warn("We received an error at the request from provider {}. " + log.warn("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) {
UserThread.runAfter(() -> { UserThread.runAfter(() -> {
log.warn("Running request!");
request(true); request(true);
}, thisRetryDelay); }, thisRetryDelay);
} else {
request(true);
}
} }
// returns true if provider selection loops back to beginning // returns true if provider selection loops back to beginning