public async Task <ServiceHealth> IsHealthOk()
        {
            ServiceHealth datasetsRepoHealth = await((IHealthChecker)_datasetRepository).IsHealthOk();
            string        queueName          = ServiceBusConstants.QueueNames.AddDefinitionRelationshipToSpecification;

            (bool Ok, string Message)messengerServiceHealth = await _messengerService.IsHealthOk(queueName);

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

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

            health.Dependencies.AddRange(datasetsRepoHealth.Dependencies);
            health.Dependencies.Add(new DependencyHealth {
                HealthOk = messengerServiceHealth.Ok, DependencyName = $"{_messengerService.GetType().GetFriendlyName()} for queue: {queueName}", Message = messengerServiceHealth.Message
            });
            health.Dependencies.Add(new DependencyHealth {
                HealthOk = cacheHealth.Ok, DependencyName = _cacheProvider.GetType().GetFriendlyName(), Message = cacheHealth.Message
            });

            return(health);
        }
Пример #2
0
 public async Task <(bool Ok, string Message)> IsHealthOk(string queueName)
 {
     return(await _messengerService.IsHealthOk(queueName));
 }