Ejemplo n.º 1
0
        public async Task <ServiceHealth> IsHealthOk()
        {
            ServiceHealth providerVersionServiceHealth = await _providerVersionService.IsHealthOk();

            ServiceHealth health = new ServiceHealth
            {
                Name = nameof(ProviderSnapshotDataLoadService)
            };

            health.Dependencies.AddRange(providerVersionServiceHealth.Dependencies);

            return(health);
        }
Ejemplo n.º 2
0
        public async Task <ServiceHealth> IsHealthOk()
        {
            ServiceHealth providerVersionServiceHealth = await _providerVersionService.IsHealthOk();

            (bool Ok, string Message)cacheRepoHealth = await _cacheProvider.IsHealthOk();

            ServiceHealth health = new ServiceHealth
            {
                Name = nameof(ScopedProvidersService)
            };

            health.Dependencies.AddRange(providerVersionServiceHealth.Dependencies);
            health.Dependencies.Add(new DependencyHealth
            {
                HealthOk       = cacheRepoHealth.Ok,
                DependencyName = cacheRepoHealth.GetType().GetFriendlyName(),
                Message        = cacheRepoHealth.Message
            });

            return(health);
        }
        public async Task <ServiceHealth> IsHealthOk()
        {
            (bool Ok, string Message) = await _searchRepository.IsHealthOk();

            ServiceHealth providerVersionMetadataRepoHealth = await((IHealthChecker)_providerVersionsMetadataRepository).IsHealthOk();

            ServiceHealth providerVersionServiceHealth = await _providerVersionService.IsHealthOk();

            ServiceHealth health = new ServiceHealth()
            {
                Name = nameof(ProviderVersionSearchService)
            };

            health.Dependencies.AddRange(providerVersionMetadataRepoHealth.Dependencies);
            health.Dependencies.AddRange(providerVersionServiceHealth.Dependencies);

            health.Dependencies.Add(new DependencyHealth {
                HealthOk = Ok, DependencyName = _searchRepository.GetType().GetFriendlyName(), Message = Message
            });

            return(health);
        }
        public async Task <ServiceHealth> IsHealthOk()
        {
            Task <ServiceHealth>[] healthChecks = new[]
            {
                ((IHealthChecker)_providerVersionMetadata).IsHealthOk(),
                _providerVersionService.IsHealthOk()
            };

            await TaskHelper.WhenAllAndThrow(healthChecks);

            ServiceHealth health = new ServiceHealth
            {
                Name = nameof(ProviderVersionService),
            };

            foreach (Task <ServiceHealth> healthCheck in healthChecks)
            {
                health.Dependencies.AddRange(healthCheck.Result.Dependencies);
            }

            return(health);
        }