Переглянути джерело

调整监控报警,拟在建在0时不报警

luojiehua 2 роки тому
батько
коміт
84a0f84647
1 змінених файлів з 10 додано та 7 видалено
  1. 10 7
      BaseDataMaintenance/dataMonitor/data_monitor.py

+ 10 - 7
BaseDataMaintenance/dataMonitor/data_monitor.py

@@ -345,6 +345,8 @@ class BaseDataMonitor():
     def monitor_proposedBuilding(self):
         current_date = getCurrent_date("%Y-%m-%d")
 
+        current_hour = getCurrent_date("%H")
+
 
         query = BoolQuery(must_queries=[
             RangeQuery("update_time",current_date),
@@ -366,13 +368,14 @@ class BaseDataMonitor():
                                                                             columns_to_get=ColumnsToGet(return_type=ColumnReturnType.NONE))
 
         total_count = total_count_doc+total_count_sp
-        _msg = "拟在建生成报警:当天生成的拟在建数量为:%d,其中公告生成:%d,审批项目生成:%d"%(total_count,total_count_doc,total_count_sp)
-        atAll=False
-        if total_count==0:
-            atAll=True
-            _msg += "\n疑似流程出现问题,请相关负责人尽快处理"
-        sentMsgToDD(_msg,ACCESS_TOKEN_DATAWORKS,atAll=atAll)
-        # sendEmail(smtp_host,smtp_username,smtp_password,self.recieviers,_msg)
+        if not (current_hour==0 or current_hour==24):
+            _msg = "拟在建生成报警:当天生成的拟在建数量为:%d,其中公告生成:%d,审批项目生成:%d"%(total_count,total_count_doc,total_count_sp)
+            atAll=False
+            if total_count==0:
+                atAll=True
+                _msg += "\n疑似流程出现问题,请相关负责人尽快处理"
+            sentMsgToDD(_msg,ACCESS_TOKEN_DATAWORKS,atAll=atAll)
+            # sendEmail(smtp_host,smtp_username,smtp_password,self.recieviers,_msg)
 
 
     def monitor_sychr(self):