配置文件开关,数据库读写分离

This commit is contained in:
橙子
2021-10-26 15:09:07 +08:00
parent b29b6be734
commit 5d5452b531
30 changed files with 397 additions and 163 deletions

View File

@@ -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;
}
}