private async Task <TechnicalResponse> GetNewResponseAndFallbackToCached(string requestText, TechnicalResponse cachedResponse, DateTime timeOfRequesting) { var latestResponse = await GetResponseRespectingLimits(requestText, timeOfRequesting); if (latestResponse != null && latestResponse.IsSuccess) { StoreResponse(latestResponse); return(latestResponse); } return(cachedResponse ?? latestResponse); }
private void StoreResponse(TechnicalResponse response) { _cachedResponses[response.RequestText] = response; }