Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
I
ils-common-video
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
提交
议题看板
打开侧边栏
OpsTeam
ils-common-video
Commits
3d397870
提交
3d397870
authored
7月 13, 2021
作者:
zw.wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: [recorder] 修改录制优先顺序
上级
efb16986
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
6 行增加
和
5 行删除
+6
-5
mysql.py
isc_video_record/db/mysql.py
+3
-3
recorder.py
isc_video_record/recorder.py
+2
-1
setup.py
setup.py
+1
-1
没有找到文件。
isc_video_record/db/mysql.py
浏览文件 @
3d397870
...
@@ -171,7 +171,7 @@ def update_video_info(cursor, conn, db_table, video_id, status,
...
@@ -171,7 +171,7 @@ def update_video_info(cursor, conn, db_table, video_id, status,
@query
(
cursor_dict
=
True
)
@query
(
cursor_dict
=
True
)
def
get_untreated_events
(
cursor
,
conn
,
db_table
,
camera_code
,
status
=
3
,
**
kw
):
def
get_untreated_events
(
cursor
,
conn
,
db_table
,
camera_code
,
status
=
3
,
order_by
=
'create_time'
,
**
kw
):
if
'retry'
in
kw
:
if
'retry'
in
kw
:
sub_str
=
'((status = 2 and next_retry_time < now()) or status = 3 or status = 0)'
sub_str
=
'((status = 2 and next_retry_time < now()) or status = 3 or status = 0)'
...
@@ -192,8 +192,8 @@ def get_untreated_events(cursor, conn, db_table, camera_code, status=3, **kw):
...
@@ -192,8 +192,8 @@ def get_untreated_events(cursor, conn, db_table, camera_code, status=3, **kw):
where device_code =
%
s
where device_code =
%
s
and create_time > date_sub(now(), interval 7 day)
and create_time > date_sub(now(), interval 7 day)
and {}
and {}
order by
create_time
order by
{}
'''
.
format
(
db_table
,
sub_str
)
'''
.
format
(
db_table
,
sub_str
,
order_by
)
cursor
.
execute
(
sql
,
[
camera_code
])
cursor
.
execute
(
sql
,
[
camera_code
])
return
cursor
.
fetchall
()
return
cursor
.
fetchall
()
...
...
isc_video_record/recorder.py
浏览文件 @
3d397870
...
@@ -141,7 +141,8 @@ class ProcessMessage:
...
@@ -141,7 +141,8 @@ class ProcessMessage:
thread_id
=
threading
.
get_ident
()
thread_id
=
threading
.
get_ident
()
ack
=
False
ack
=
False
events
=
mysql
.
get_untreated_events
(
body
[
'db_table'
],
body
[
'camera_code'
],
retry
=
True
)
events
=
mysql
.
get_untreated_events
(
body
[
'db_table'
],
body
[
'camera_code'
],
order_by
=
'start_time desc'
,
retry
=
True
)
log
.
info
(
'
%
s: events count:
%
s'
,
body
[
'camera_code'
],
len
(
events
))
log
.
info
(
'
%
s: events count:
%
s'
,
body
[
'camera_code'
],
len
(
events
))
for
event
in
events
:
for
event
in
events
:
...
...
setup.py
浏览文件 @
3d397870
...
@@ -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.0b1
6
'
,
version
=
'1.0.0b1
7
'
,
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论