提交 7807b705 authored 作者: blu's avatar blu

humandetect: revise camera configure api

上级 4d8744c8
......@@ -191,7 +191,8 @@ def getRegionConfig(ipcSN):
if ipcSN in CAMERA_CONFIG_MAP and type(CAMERA_CONFIG_MAP[ipcSN]) is dict:
region = CAMERA_CONFIG_MAP[ipcSN]['region']
elif CAMERA_CONFIG_MAP.get(ipcSN) is None and API_HOST:
res = requests.get(API_HOST + API_CAMERA_CFG_URI.format(ipcSN))
reqUrl = API_HOST + API_CAMERA_CFG_URI.format(ipcSN)
res = requests.get(reqUrl)
try:
if res.status_code == 200:
ret = res.json()
......@@ -202,7 +203,7 @@ def getRegionConfig(ipcSN):
CAMERA_CONFIG_MAP[ipCSN] = 0
except Exception as e:
print("failed to get camera config {}: {}".format(ipcSN, e))
print("getRegionConfig: {}: {}".format(ipcSN, json.dumps(region)))
print("getRegionConfig: {}, {}, {}: {}".format(ipcSN, reqUrl, res.text, json.dumps(region)))
return region
def take_task(task):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论