You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
969 B
C#

using Furion;
using Furion.DataEncryption;
using Furion.EventBus;
using Furion.Logging;
using Furion.TaskScheduler;
using ICSharpCode.SharpZipLib.Zip;
using Myshipping.Core.Entity;
using Myshipping.Core.Service;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Job
{
/// <summary>
/// 日志清理
/// </summary>
public class LogZipClearWorker : ISpareTimeWorker
{
[SpareTime(60000, "LogZipClearWorker", Description = "日志压缩清理", DoOnce = false, StartNow = true, ExecuteType = SpareTimeExecuteTypes.Serial)]
public void LogZipClear(SpareTimer timer, long count)
{
Log.Information($"日志清理 {DateTime.Now}");
var evtPub = App.GetService<IEventPublisher>();
evtPub.PublishAsync(new ChannelEventSource("LogZipClear:DoWork"));
}
}
}