|
|
@ -2,15 +2,16 @@ |
|
|
|
|
|
|
|
public static class CustomExtensionMethods |
|
|
|
{ |
|
|
|
public static IServiceCollection AddRedis(this IServiceCollection services, IConfiguration configuration) |
|
|
|
public static IServiceCollection AddHealthChecks(this IServiceCollection services, IConfiguration configuration) |
|
|
|
{ |
|
|
|
services.AddHealthChecks() |
|
|
|
.AddRedis(_ => |
|
|
|
{ |
|
|
|
return configuration.GetConnectionString("redis"); |
|
|
|
}, |
|
|
|
"redis", tags: new[] { "ready", "liveness" }); |
|
|
|
.AddRedis(_ => configuration.GetConnectionString("redis"), "redis", tags: new[] { "ready", "liveness" }); |
|
|
|
|
|
|
|
return services; |
|
|
|
} |
|
|
|
|
|
|
|
public static IServiceCollection AddRedis(this IServiceCollection services, IConfiguration configuration) |
|
|
|
{ |
|
|
|
return services.AddSingleton(sp => |
|
|
|
{ |
|
|
|
var redisConfig = ConfigurationOptions.Parse(configuration.GetConnectionString("redis"), true); |
|
|
|