配置文件更改

This commit is contained in:
陈淳
2022-10-26 20:01:18 +08:00
parent fd9f3d04d9
commit 3a634d7888
11 changed files with 577 additions and 248 deletions

View File

@@ -0,0 +1,37 @@
using log4net;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yi.Framework.Common.Models;
using Yi.Framework.Core;
namespace Yi.Framework.WebCore.MiddlewareExtend
{
public static class CacheInitExtend
{
private static readonly ILog log = LogManager.GetLogger(typeof(CacheInitExtend));
public static void UseRedisSeedInitService(this IApplicationBuilder app )
{
if (Appsettings.appBool("CacheSeed_Enabled"))
{
var _cacheClientDB = app.ApplicationServices.GetService<CacheInvoker>();
try
{
//RedisInit.Seed(_cacheClientDB);
}
catch (Exception e)
{
log.Error($"Error occured seeding the RedisInit.\n{e.Message}");
throw;
}
}
}
}
}