feat: 算法处理失败时邮件通知
This commit is contained in:
parent
9d9e670240
commit
c4e44cda26
|
@ -5,6 +5,8 @@ import cv2
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
|
from apps.utils.tasks import send_mail_task
|
||||||
|
import traceback
|
||||||
|
|
||||||
myLogger = logging.getLogger('log')
|
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) # 绘制矩形框
|
draw(global_img_local, results) # 绘制矩形框
|
||||||
results.update({'global_img': global_img_path})
|
results.update({'global_img': global_img_path})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
send_mail_task.delay(message=traceback.format_exc())
|
||||||
myLogger.error('算法返回信息处理错误', exc_info=True)
|
myLogger.error('算法返回信息处理错误', exc_info=True)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue