feat: 算法处理失败时邮件通知

This commit is contained in:
caoqianming 2023-06-07 14:51:37 +08:00
parent 9d9e670240
commit c4e44cda26
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,8 @@ import cv2
from django.conf import settings
import logging
import math
from apps.utils.tasks import send_mail_task
import traceback
myLogger = logging.getLogger('log')
@ -98,6 +100,7 @@ def ai_analyse_2(codes: list, global_img: str, face_img: str = '', is_dahua_pic:
draw(global_img_local, results) # 绘制矩形框
results.update({'global_img': global_img_path})
except Exception as e:
send_mail_task.delay(message=traceback.format_exc())
myLogger.error('算法返回信息处理错误', exc_info=True)
return results