Backup/Discuz.Config/DbSnapConfigs.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using Discuz.Common.Generic;
namespace Discuz.Config
{
/// <summary>
/// 论坛快照设置类
/// </summary>
public class DbSnapConfigs
{
private static object lockHelper = new object();
private static System.Timers.Timer dbSnapConfigTimer = new System.Timers.Timer(60000);
private static DbSnapAppConfig m_dbSnapAppConfig;
/// <summary>
/// 静态构造函数初始化相应实例和定时器
/// </summary>
static DbSnapConfigs()
{
m_dbSnapAppConfig = DbSnapConfigFileManager.LoadConfig();
dbSnapConfigTimer.AutoReset = true;
dbSnapConfigTimer.Enabled = true;
dbSnapConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
dbSnapConfigTimer.Start();
}
private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
ResetConfig();
}
/// <summary>
/// 有效的数据快照列表
/// </summary>
private static List<DbSnapInfo> enableSnapList = null;
/// <summary>
/// 获取有效的数据快照列表
/// </summary>
/// <returns></returns>
public static List<DbSnapInfo> GetEnableSnapList()
{
if (enableSnapList == null)
{
if (m_dbSnapAppConfig != null)
{
enableSnapList = new List<DbSnapInfo>();
foreach (DbSnapInfo dbSnapInfo in m_dbSnapAppConfig.DbSnapInfoList)
{
if (dbSnapInfo.Enable && !string.IsNullOrEmpty(dbSnapInfo.DbconnectString))
enableSnapList.Add(dbSnapInfo);
}
}
}
return enableSnapList;
}
后面还有 37 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
