示例#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);
        }