Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 private void StoreResponse(TechnicalResponse response)
 {
     _cachedResponses[response.RequestText] = response;
 }