Exemple #1
0
 public CommandHealthProbeService(
     HealthCheckService healthCheckService,
     ILogger <TcpHealthProbeService> logger,
     CommandHealthProbeOptions options)
 {
     _healthCheckService = healthCheckService ?? throw new ArgumentNullException(nameof(healthCheckService));
     _logger             = logger;
     _options            = options;
 }
Exemple #2
0
        public static IServiceCollection AddCommandHealthProbe(
            this IServiceCollection services,
            Action <CommandHealthProbeOptions> setupOptions)
        {
            var options = new CommandHealthProbeOptions();

            setupOptions(options);

            services.AddSingleton(options);

            services.AddHealthChecks();

            services.AddHostedService <CommandHealthProbeService>();

            return(services);
        }