public CommandHealthProbeService( HealthCheckService healthCheckService, ILogger <TcpHealthProbeService> logger, CommandHealthProbeOptions options) { _healthCheckService = healthCheckService ?? throw new ArgumentNullException(nameof(healthCheckService)); _logger = logger; _options = options; }
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); }