开启作业监控前关闭可能存在的
This commit is contained in:
parent
93a00363b2
commit
1646621844
|
@ -87,7 +87,7 @@ def ai_analyse_2(codes: list, global_img: str, face_img: str = '', is_dahua_pic:
|
|||
face_img (str): 人脸图片url地址
|
||||
"""
|
||||
results = ai_analyse(codes, global_img, face_img, is_dahua_pic)
|
||||
if results: # 如果触发事件先保存下来
|
||||
if results and is_dahua_pic: # 如果触发事件且是大华图片先保存下来
|
||||
from apps.ecm.service import save_dahua_pic
|
||||
global_img_path = save_dahua_pic(global_img)
|
||||
global_img_local = settings.BASE_DIR + global_img_path
|
||||
|
|
|
@ -114,6 +114,8 @@ class OplViewSet(CustomModelViewSet):
|
|||
if obj.mtask_uid:
|
||||
# 先关闭
|
||||
close_mtask(obj.mtask_uid)
|
||||
obj.mtask_uid = None
|
||||
obj.save()
|
||||
res = start_mtask(obj)
|
||||
return Response(res)
|
||||
|
||||
|
|
Loading…
Reference in New Issue