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