using Rhea.Common;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading;
|
using System.Threading.Tasks;
|
using Tiger.Business.DbCache;
|
using Tiger.IBusiness;
|
|
namespace Tiger.Business
|
{
|
/// <summary>
|
/// 监控总控
|
/// </summary>
|
public class DbCacheBus : IDbCacheBus
|
{
|
public static SysParamCache SysParamCache = new();
|
public static SysParamCacheOld SysParamCacheOld = new();
|
public static CodeRuleCache CodeRuleCache = new();
|
#region Functions
|
public ISysParamCache GetSysParamCache() => SysParamCache;
|
public ICodeRuleCache GetCodeRuleCache() => CodeRuleCache;
|
public void StartAutoUpdate()
|
{
|
if (BizConfig.Configuration["IsUseDbCache"]?.ToLower() == "true")
|
{
|
//开启系统参数缓存
|
SysParamCache.Start();
|
SysParamCacheOld.Start();
|
ConsoleExt.WriteLine("Start SysParam Cache Auto Update Thread..........", ConsoleColor.Yellow);
|
//开启系统参数缓存
|
CodeRuleCache.Start();
|
ConsoleExt.WriteLine("Start CodeRule Cache Auto Update Thread..........", ConsoleColor.Yellow);
|
}
|
}
|
|
public void StopAutoUpdate()
|
{
|
if (BizConfig.Configuration["IsUseDbCache"]?.ToLower() == "true")
|
{
|
//关闭系统参数缓存
|
SysParamCache.Stop();
|
SysParamCacheOld.Stop();
|
//关闭系统参数缓存
|
CodeRuleCache.Stop();
|
}
|
}
|
#endregion
|
}
|
}
|