增大上传超时时间
This commit is contained in:
@@ -161,13 +161,13 @@ class BaseFrameProcessorWorker(threading.Thread):
|
|||||||
'video': f,
|
'video': f,
|
||||||
'metadata': (None, json.dumps(msg))
|
'metadata': (None, json.dumps(msg))
|
||||||
}
|
}
|
||||||
response = requests.post(constants.ALERT_PUSH_URL, files=files, timeout=10.0)
|
response = requests.post(constants.ALERT_PUSH_URL, files=files, timeout=60.0)
|
||||||
else:
|
else:
|
||||||
# 无视频,也使用 multipart/form-data
|
# 无视频,也使用 multipart/form-data
|
||||||
files = {
|
files = {
|
||||||
'metadata': (None, json.dumps(msg))
|
'metadata': (None, json.dumps(msg))
|
||||||
}
|
}
|
||||||
response = requests.post(constants.ALERT_PUSH_URL, files=files, timeout=5.0)
|
response = requests.post(constants.ALERT_PUSH_URL, files=files, timeout=30.0)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
logger.info(f"[INFO] POST alert sent successfully for actions: {msg.get('result_type')}")
|
logger.info(f"[INFO] POST alert sent successfully for actions: {msg.get('result_type')}")
|
||||||
@@ -387,6 +387,7 @@ class BaseFrameProcessorWorker(threading.Thread):
|
|||||||
# 检查是否超过推送间隔
|
# 检查是否超过推送间隔
|
||||||
if current_time - last_push >= ALERT_PUSH_INTERVAL:
|
if current_time - last_push >= ALERT_PUSH_INTERVAL:
|
||||||
push_actions.append(action)
|
push_actions.append(action)
|
||||||
|
# push_actions.append(get_alert_label(action))
|
||||||
# 更新该action的最后推送时间
|
# 更新该action的最后推送时间
|
||||||
self.last_alert_push_time[cam_id][action] = current_time
|
self.last_alert_push_time[cam_id][action] = current_time
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user