using Rhea.Common;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading;
|
using System.Threading.Tasks;
|
using Tiger.IBusiness;
|
|
namespace Tiger.Api.DbCache
|
{
|
public partial class Cache
|
{
|
/// <summary>
|
/// 获取条码规则缓存
|
/// </summary>
|
public static ICodeRuleCache CodeRule => DI.Resolve<ICodeRuleCache>();
|
/// <summary>
|
/// 获取系统参数缓存
|
/// </summary>
|
public static ISysParamCache SysParam => DI.Resolve<ISysParamCache>();
|
/// <summary>
|
/// 获取不良代码缓存
|
/// </summary>
|
public static IMesDefectCache MesDefect => DI.Resolve<IMesDefectCache>();
|
/// <summary>
|
/// 获取岗位缓存
|
/// </summary>
|
public static IMesPositionCache MesPosition => DI.Resolve<IMesPositionCache>();
|
}//endClass
|
|
/// <summary>
|
/// 监控总控
|
/// </summary>
|
public class DbCacheBus
|
{
|
|
#region Functions
|
public static void StartAutoUpdate()
|
{
|
if (BizConfig.Configuration["IsUseDbCache"]?.ToLower() == "true")
|
{
|
//开启系统参数缓存
|
Cache.SysParam.Start();
|
ConsoleExt.WriteLine("Start SysParam Cache Auto Update Thread..........", ConsoleColor.Yellow);
|
//开启系统参数缓存
|
Cache.CodeRule.Start();
|
ConsoleExt.WriteLine("Start CodeRule Cache Auto Update Thread..........", ConsoleColor.Yellow);
|
//开启不良代码缓存
|
Cache.MesDefect.Start();
|
ConsoleExt.WriteLine("Start MesDefect Cache Auto Update Thread..........", ConsoleColor.Yellow);
|
//开启岗位缓存
|
Cache.MesPosition.Start();
|
ConsoleExt.WriteLine("Start MesPosition Cache Auto Update Thread..........", ConsoleColor.Yellow);
|
}
|
}
|
|
public static void StopAutoUpdate()
|
{
|
if (BizConfig.Configuration["IsUseDbCache"]?.ToLower() == "true")
|
{
|
//关闭系统参数缓存
|
Cache.SysParam.Stop();
|
//关闭系统参数缓存
|
Cache.CodeRule.Stop();
|
//关闭不良代码缓存
|
Cache.MesDefect.Stop();
|
//关闭岗位缓存
|
Cache.MesPosition.Stop();
|
}
|
}
|
#endregion
|
}
|
}
|