old_flsystem/应用/AutoAnswer/LogClearThread.cs

24 lines
631 B
C#

using Api.Framework;
using Api.Framework.SDK;
using System;
namespace AutoAnswer
{
class LogClearThread : TimerTask
{
public override void Run(object state, bool timedOut)
{
try
{
if (Class1.Config.Is_AutoClear_Start)
{
var session = ApiClient.GetSession();
session.ExcuteSQL($"delete from fl_plugin_autoanswer_log where datetime <= '{DateTime.Now.AddDays(-Class1.Config.Logs_Keep_Days).ToString("yyyy-MM-dd HH:mm:ss")}'");
}
}
catch
{}
}
}
}