添加自动识别脚本监控,提示自动识别脚本卡住
This commit is contained in:
@@ -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
|
||||
@@ -83,7 +85,7 @@ def send_data(html_msg, v_head, i):
|
||||
# 邮件发送和接收人yuhong@fucb.cn
|
||||
|
||||
sender = username
|
||||
receiver = ["jsxuzl@qq.com","1515783401@qq.com"]
|
||||
receiver = ["jsxuzl@qq.com", "1515783401@qq.com"]
|
||||
# receiver = ["xuzhengliang@fucb.cn","jsxuzl@qq.com","1804996986@qq.com"]
|
||||
|
||||
# receiver = ['jsxuzl@qq.com']
|
||||
@@ -117,8 +119,8 @@ def sync_dbtarget(source_cursor,source_conn,target_cursor,target_db,i_sync_fiel
|
||||
if i_query_sql.count('%s'):
|
||||
source_cursor.execute(i_query_sql,(i_sync_begindate))
|
||||
else:
|
||||
source_cursor.execute(i_query_sql)
|
||||
|
||||
source_cursor.execute(i_query_sql)
|
||||
|
||||
from_data=source_cursor.fetchall()
|
||||
v_fiels_count=i_sync_fields.count(',')+1
|
||||
v_fiels_list=i_sync_fields.replace('\n','').replace(' ','').split(',')
|
||||
@@ -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='';
|
||||
|
||||
Reference in New Issue
Block a user