1.朋友圈工具跟发逻辑优化
This commit is contained in:
parent
b7c634141e
commit
d23ad73d71
|
@ -76,6 +76,7 @@ namespace CircleFriendsTools
|
|||
|
||||
Config = this.ReadConfig<Config>();
|
||||
var thread = TimerTask.NewTimer<MonitorThread>(1) as MonitorThread; //创建线程 - 监听好友朋友圈和接口的线程 1秒
|
||||
thread.Init();
|
||||
thread.plugin = this;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
@ -52,12 +52,11 @@ namespace CircleFriendsTools
|
|||
/// </summary>
|
||||
private static BlockingCollection<WaitSendCircleInfo> waitSendCircleInfoList = new BlockingCollection<WaitSendCircleInfo>();
|
||||
|
||||
|
||||
static MonitorThread()
|
||||
public void Init()
|
||||
{
|
||||
var th = new Thread(() =>
|
||||
{
|
||||
foreach (var circleInfo in waitSendCircleInfoList)
|
||||
foreach (var circleInfo in waitSendCircleInfoList.GetConsumingEnumerable())
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -364,6 +363,7 @@ namespace CircleFriendsTools
|
|||
|
||||
if (isNews)
|
||||
{
|
||||
EventClient.OnEvent(this, $"朋友圈工具 - 采集到新朋友圈内容 等待发送数量 => {waitSendCircleInfoList.Count}");
|
||||
if (!string.IsNullOrWhiteSpace(newestTime))
|
||||
{
|
||||
Class1.Config.MonitorInfoHistoryTime = newestTime;
|
||||
|
|
|
@ -10,6 +10,7 @@ using System.Text;
|
|||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Api.Framework.Utils;
|
||||
|
||||
namespace Api.Framework.Tools
|
||||
{
|
||||
|
@ -403,7 +404,7 @@ namespace Api.Framework.Tools
|
|||
if (reg.Success)
|
||||
db_name = reg.Groups["db_name"].ToString();
|
||||
|
||||
var row = session.FindRow("SELECT * FROM information_schema.statistics WHERE table_schema = @db_name and table_name = @tableName AND index_name = @indexName", new { db_name = db_name, tableName = tableName, indexName = tableName+ "__" + indexName });
|
||||
var row = session.FindRow("SELECT * FROM information_schema.statistics WHERE table_schema = @db_name and table_name = @tableName AND index_name = @indexName", new { db_name = db_name, tableName = tableName, indexName = tableName + "__" + indexName });
|
||||
if (row != null) return true;
|
||||
}
|
||||
else if (session.CurrentConnectionConfig.DbType == DbType.Sqlite)
|
||||
|
@ -724,7 +725,7 @@ namespace Api.Framework.Tools
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
EventClient.OnEvent("", $"增加字段异常:{ex.Message} - {tableName} - {columnName} - {sqlType}");
|
||||
LogHelper.GetSingleObj().Error("启动表字段检测", $"增加字段异常:{ex.Message} - {tableName} - {columnName} - {sqlType}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue