Przeglądaj źródła

feat:添加分析任务

zhaohaipeng 10 miesięcy temu
rodzic
commit
1b7f52a16c
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      feature_spark_monitor.py

+ 4 - 4
feature_spark_monitor.py

@@ -112,9 +112,9 @@ def send_error_info(table_name: str, latest_started_time: str, webhook: str):
 
 def _main():
     # 读取配置文件
-    # config = configparser.ConfigParser()
-    # config.read("/home/monitor/model_monitor/config/config.ini")
-    # webhook_url = config.get("feishu", "model.webhook")
+    config = configparser.ConfigParser()
+    config.read("/home/monitor/model_monitor/config/config.ini")
+    webhook_url = config.get("feishu", "model.webhook")
 
     # 获取最近七小时的Spark任务
     hours_7_early = int((datetime.now() - timedelta(hours=7)).timestamp()) * 1000
@@ -131,7 +131,7 @@ def _main():
         b, latest_started_time = handle_table(table_name, result)
         if b:
             print(f"表: {table_name}, 最后一次同步时间距当前时间超过140分钟")
-            # send_error_info(table_name, latest_started_time, webhook_url)
+            send_error_info(table_name, latest_started_time, webhook_url)
 
 
 if __name__ == '__main__':