Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
I
ils-common-video
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
提交
议题看板
打开侧边栏
OpsTeam
ils-common-video
Commits
8a4eef48
提交
8a4eef48
authored
6月 19, 2021
作者:
zw.wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: [recorder] 修复下载文件不存在时异常
上级
7e754e53
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
3 行删除
+17
-3
recorder.py
isc_video_record/recorder.py
+3
-2
api_helper.py
isc_video_record/utils/api_helper.py
+13
-0
setup.py
setup.py
+1
-1
没有找到文件。
isc_video_record/recorder.py
浏览文件 @
8a4eef48
...
@@ -95,7 +95,7 @@ class StreamRecorder:
...
@@ -95,7 +95,7 @@ class StreamRecorder:
on_message
,
args
=
(
self
.
connection
,
threads
))
on_message
,
args
=
(
self
.
connection
,
threads
))
# 设置消费能力
# 设置消费能力
self
.
channel
.
basic_qos
(
prefetch_count
=
dynaconf
.
settings
.
get
(
'PREFETCH_COUNT'
,
5
0
))
self
.
channel
.
basic_qos
(
prefetch_count
=
dynaconf
.
settings
.
get
(
'PREFETCH_COUNT'
,
8
0
))
self
.
channel
.
basic_consume
(
on_message_callback
=
on_message_callback
,
self
.
channel
.
basic_consume
(
on_message_callback
=
on_message_callback
,
queue
=
self
.
queue_name
)
queue
=
self
.
queue_name
)
...
@@ -178,7 +178,8 @@ class ProcessMessage:
...
@@ -178,7 +178,8 @@ class ProcessMessage:
aliyun_oss
.
oss_download_file
(
event
[
'video_url'
],
part_file_name
)
aliyun_oss
.
oss_download_file
(
event
[
'video_url'
],
part_file_name
)
if
os
.
path
.
isfile
(
part_file_name
):
if
os
.
path
.
isfile
(
part_file_name
):
part_files_set
.
add
(
part_file_name
)
part_files_set
.
add
(
part_file_name
)
raise
FileExistsError
(
part_file_name
)
else
:
raise
FileExistsError
(
part_file_name
)
except
Exception
as
e
:
except
Exception
as
e
:
log
.
exception
(
e
)
log
.
exception
(
e
)
event
[
'recovered_time'
]
=
event
[
'start_time'
]
event
[
'recovered_time'
]
=
event
[
'start_time'
]
...
...
isc_video_record/utils/api_helper.py
浏览文件 @
8a4eef48
...
@@ -62,6 +62,19 @@ class IntelabApiHelper:
...
@@ -62,6 +62,19 @@ class IntelabApiHelper:
for
pre_event
in
pre_events
:
for
pre_event
in
pre_events
:
# 合并时间间隔较短的事件
# 合并时间间隔较短的事件
# TODO online=0的处理
'''
{
"deviceType": null,
"regionIndexCode": "bb488f00-486e-4f6d-afde-24e22a13c427",
"collectTime": "2021-06-19T18:32:27.000+08:00",
"deviceIndexCode": null, "ip": null, "regionName": "
\u9e7f\u57ce\u533a
",
"indexCode": "7a22574c7dae4f869b1f3dca55587175",
"cn": "
\u9e7f\u57ce\u533a\u5434\u7acb\u695a\u53e3\u8154\u706d\u83cc\u95f4
",
"treatyType": "1", "manufacturer": null, "port": null,
"online": 0
}
'''
if
'beginTime'
not
in
pre_event
:
if
'beginTime'
not
in
pre_event
:
log
.
exception
(
ValueError
(
json
.
dumps
(
pre_event
)))
log
.
exception
(
ValueError
(
json
.
dumps
(
pre_event
)))
continue
continue
...
...
setup.py
浏览文件 @
8a4eef48
...
@@ -24,7 +24,7 @@ requires = [
...
@@ -24,7 +24,7 @@ requires = [
setuptools
.
setup
(
setuptools
.
setup
(
name
=
'isc-video-record'
,
name
=
'isc-video-record'
,
version
=
'1.0.0b
5
'
,
version
=
'1.0.0b
6
'
,
description
=
'ISC motion detection playback video stream recording service.'
,
description
=
'ISC motion detection playback video stream recording service.'
,
long_description
=
long_description
,
long_description
=
long_description
,
long_description_content_type
=
'text/markdown'
,
long_description_content_type
=
'text/markdown'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论