添加自动识别脚本监控,提示自动识别脚本卡住

This commit is contained in:
2025-03-04 16:53:14 +08:00
parent 4beb4ffd8c
commit 3f757a28a9
2 changed files with 14 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
services:
fcb_ai_db_sync:
image: fcb_ai_db_sync:1.1.1
image: fcb_ai_db_sync:1.1.2
restart: always
build:
context: .

View File

@@ -34,6 +34,8 @@ from email.mime.text import MIMEText # 构建邮件正文可以是text
from email.mime.application import MIMEApplication # 构建邮件附件理论上只要是文件即可一般是图片Excel表格word文件等
from email.header import Header # 专门构建邮件标题的,这样做,可以支持标题中文
from auto_email.error_email import send_error_email
#import pysnooper
#import base64
@@ -160,6 +162,14 @@ def sync_dbtarget(source_cursor,source_conn,target_cursor,target_db,i_sync_fiel
if divmod(j, 1000)[1] == 0:
logging.info("已经插入"+i_imp_table_name+":" +str(j) + "")
logging.info("插入"+i_imp_table_name+":" + str(j - 1) + "")
# 如果工作时间段中识别案子为0邮件警告
if i_imp_table_name == "imp_ie_settlement" and j - 1 == 0:
now = datetime.now()
hour = now.hour
if 9 <= hour < 17:
send_error_email('AI赋能数据库同步脚本', '无自动识别结果', '请检查自动识别脚本是否正常运行')
if v_pk_phhd[1:] != '':
v_sql ='';
v_mess='';