示例#1
0
        private async Task <ServiceStatus> GetStatsServiceStatus(IStatsService service, bool deep)
        {
            var status = new ServiceStatus(Health.Healthy, service.Name);

            try
            {
                if (deep)
                {
                    await service.GetAsync(Platform.Pc, Region.Na, "woodman-11497");

                    service.Enable();
                }
                else if (service.Disabled)
                {
                    status.Health = Health.Unavailable;
                }
            }
            catch (Exception ex)
            {
                _logger.LogWarning(ex, $"{service.Name} is unavailable.");

                service.Disable();

                status.Health = Health.Unavailable;
            }

            return(status);
        }
示例#2
0
 public Task <StatReport> GetAsync([FromQuery] string selectedCountry, [FromQuery] string selectedCountryCode, [FromQuery] string ip)
 {
     return(_statsService.GetAsync(selectedCountry, selectedCountryCode, ip));
 }