celery task 错误

This commit is contained in:
曹前明 2022-08-26 16:44:46 +08:00
parent f139b96c51
commit 47355e1e3a
1 changed files with 3 additions and 2 deletions

View File

@ -3,10 +3,11 @@ from multiprocessing import Event
from threading import Thread from threading import Thread
from celery import shared_task from celery import shared_task
from apps.ai.main import ai_analyse
from apps.am.models import Area from apps.am.models import Area
from apps.ecm.models import EventCate, Eventdo from apps.ecm.models import EventCate, Eventdo
from apps.ecm.service import algo_handle, notify_event, save_dahua_pic from apps.ecm.service import notify_event, save_dahua_pic
from apps.hrm.models import Employee from apps.hrm.models import Employee
from apps.opm.models import Opl from apps.opm.models import Opl
from apps.third.clients import xxClient from apps.third.clients import xxClient
@ -80,7 +81,7 @@ def snap_and_analyse(code: str, algo_codes: list, opl_id: str):
global_img_o = dhClient.snap(code) global_img_o = dhClient.snap(code)
happen_time = timezone.now() happen_time = timezone.now()
vchannel = TDevice.objects.filter(code=code).first() vchannel = TDevice.objects.filter(code=code).first()
ec_codes = algo_handle(algo_codes, data={}) # 算法处理返回的事件结果 ec_codes = ai_analyse(algo_codes, global_img=global_img_o) # 算法处理返回的事件结果
if ec_codes: if ec_codes:
# 获取本次所有发生事件种类 # 获取本次所有发生事件种类
ecs = EventCate.objects.filter(code__in=ec_codes) ecs = EventCate.objects.filter(code__in=ec_codes)