public static IHealthCheckBuilder AddRedisCheck(this IHealthCheckBuilder builder, string name,
                                                        string connectionString, Action <RedisCheckOptions> configureOptions)
        {
            var options = new RedisCheckOptions();

            configureOptions(options);

            return(builder.AddCheck(new RedisCheck(name, connectionString, options)));
        }
예제 #2
0
        public RedisCheck(string name, IConnectionMultiplexer connectionMultiplexer, RedisCheckOptions options)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (connectionMultiplexer == null)
            {
                throw new ArgumentNullException(nameof(connectionMultiplexer));
            }

            Name     = name;
            _options = options ?? throw new ArgumentNullException();
            _connectionMultiplexerLazy = new Lazy <IConnectionMultiplexer>(() => connectionMultiplexer);
        }