Beispiel #1
0
        public async Task <List <Cinema> > GetCinemas(string city)
        {
            try
            {
                var cinemas = await TaskRetryHelper.WithRetry(() => GetCinemasFromApi(city), MaxRetriesApiCalls).ConfigureAwait(false);

                return(cinemas);
            }
            catch (TaskCanceledException e)
            {
                m_logger.LogError(e, $"Max Timeout Number exceeded the limit of {MaxRetriesApiCalls}");
                throw;
            }
        }
Beispiel #2
0
        public async Task <DayOverview> GetDayOverviewForCinema(Cinema cinema, DateTime showDate, string daytime)
        {
            try
            {
                var shows = await TaskRetryHelper.WithRetry(() => GetShowsFromApi(cinema, showDate), MaxRetriesApiCalls).ConfigureAwait(false);

                m_logger.LogDebug("Parsing day overview");
                var dayOverview = ParseDayOverview(cinema, shows, showDate, daytime);
                return(dayOverview);
            }
            catch (TaskCanceledException e)
            {
                m_logger.LogError(e, $"Max Timeout Number exceeded the limit of {MaxRetriesApiCalls}");
                throw;
            }
        }