From c4a9819caba9635cb5994efae1242ca58fe82add Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Wed, 20 Sep 2023 10:41:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86oplog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Job/LogJobWorker.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Myshipping.Core/Job/LogJobWorker.cs b/Myshipping.Core/Job/LogJobWorker.cs index cc3b8e7a..2a73bdab 100644 --- a/Myshipping.Core/Job/LogJobWorker.cs +++ b/Myshipping.Core/Job/LogJobWorker.cs @@ -100,11 +100,15 @@ public class LogJobWorker : ISpareTimeWorker, IDynamicApiController, ITransient Log.Information($"准备清理天{daysAgo}之前的日志LogOp"); - // 生成查询表达式 - Expression> expression = ex => ex.OpTime < DateTime.Now.AddDays(-daysAgo); + //// 生成查询表达式 + //Expression> expression = ex => ex.OpTime < DateTime.Now.AddDays(-daysAgo); - // 执行删除 - DoDeleteWork(expression); + //// 执行删除 + //DoDeleteWork(expression); + + + var repLogOp = App.GetService>(); + repLogOp.Delete(x => x.OpTime < DateTime.Today.AddDays(-daysAgo)); } ///