mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-03-18 15:36:37 +08:00
配置文件开关,数据库读写分离
This commit is contained in:
@@ -14,7 +14,10 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
{
|
||||
public static IServiceCollection AddRedisService(this IServiceCollection services)
|
||||
{
|
||||
services.Configure<RedisConnOptions>(Appsettings.appConfiguration("RedisConn"));
|
||||
if (Appsettings.appBool("Redis_Enabled"))
|
||||
{
|
||||
services.Configure<RedisConnOptions>(Appsettings.appConfiguration("RedisConn"));
|
||||
}
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user