예제 #1
0
        public async Task <IActionResult> GetLatestTime()
        {
            _log.LogDebug($"Fetching GET latest change date");

            DateTime?latestChange = DateTime.UtcNow;

            try
            {
                var result = _retryService.RetryPolicy($"<roatpService>/api/v1/download/roatp-summary/most-recent").ExecuteAsync(context => _apiClient.GetLatestNonOnboardingOrganisationChangeDate(), new Context());
                if (result.Result != null)
                {
                    latestChange = result.Result;
                }
            }
            catch (Exception ex)
            {
                _log.LogError($"Unable to retrieve latest change date", ex);
            }

            return(Ok(latestChange));
        }