From efa7310c7b32e6296d637332251dc4519c4c5aea Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 10 9月 2024 13:02:13 +0800
Subject: [PATCH] 执行删除计划
---
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DeleteDataHandler.cs | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DeleteDataHandler.cs b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DeleteDataHandler.cs
index dab6f68..6c77f3e 100644
--- a/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DeleteDataHandler.cs
+++ b/DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_BusinessLogical/DataCaptureHandlerV2/DeleteDataHandler.cs
@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Data.Entity.Core.Common.CommandTrees;
+using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
using System.Data.Entity.Validation;
using System.Data.SqlTypes;
using System.Diagnostics;
@@ -57,6 +58,16 @@
{
try
{
+ //Thread.Sleep(8 * 60 * 60 * 1000);//姣忓ぉ8灏忔椂涓�娆�
+ Thread.Sleep(20 * 60 * 1000);//20鍒嗛挓鎵ц涓�娆�
+
+ //姣忓ぉ鍑屾櫒1銆�3銆�5銆�6鎵ц涓�娆�
+ var hour = DateTime.Now.Hour;
+ if (!(hour == 1 || hour == 3 || hour == 5 || hour == 6))
+ {
+ continue;
+ }
+
try
{
LogTextHelper.BatchDeleteLog();
@@ -81,6 +92,8 @@
ClearDataHandler.Delete_sys_log_op(7);
ClearDataHandler.Delete_sys_log_ex(7);
+
+ ClearDataHandler.Delete_EquipmentWorkingLog(7);
Log4NetHelper.WriteInfoLog(logType, $"瀹氭椂鍒犻櫎琛ㄦ暟鎹垚鍔燂細");
}
@@ -185,7 +198,7 @@
}
- Thread.Sleep(8 * 60 * 60 * 1000);//姣忓ぉ8灏忔椂涓�娆�
+
}
catch (Exception ex)
{
--
Gitblit v1.9.3