Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
openEuler-Advisor
提交
1cc17308
O
openEuler-Advisor
项目概览
openeuler
/
openEuler-Advisor
通知
40
Star
4
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openEuler-Advisor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1cc17308
编写于
9月 10, 2020
作者:
G
gongzt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
定时器触发问题和包的维护人信息获取
上级
b8d5dfac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
11 deletion
+17
-11
packageship/packageship/application/__init__.py
packageship/packageship/application/__init__.py
+10
-5
packageship/packageship/application/apps/lifecycle/function/download_yaml.py
...ship/application/apps/lifecycle/function/download_yaml.py
+7
-6
未找到文件。
packageship/packageship/application/__init__.py
浏览文件 @
1cc17308
...
...
@@ -22,13 +22,18 @@ def _timed_task(app):
from
.apps.lifecycle.function.download_yaml
import
update_pkg_info
# pylint: disable=import-outside-toplevel
_readconfig
=
ReadConfig
(
system_config
.
SYS_CONFIG_PATH
)
_hour
=
_readconfig
.
get_config
(
'TIMEDTASK'
,
'hour'
)
if
not
_hour
or
not
isinstance
(
_hour
,
int
)
or
_hour
<
0
or
_hour
>
23
:
try
:
_hour
=
int
(
_readconfig
.
get_config
(
'TIMEDTASK'
,
'hour'
))
_minute
=
int
(
_readconfig
.
get_config
(
'TIMEDTASK'
,
'minute'
))
except
ValueError
:
_hour
=
3
_minute
=
_readconfig
.
get_config
(
'TIMEDTASK'
,
'minute'
)
if
not
_hour
or
not
isinstance
(
_hour
,
int
)
or
_hour
<
0
or
_hour
>
59
:
_minute
=
0
else
:
if
_hour
<
0
or
_hour
>
23
:
_hour
=
3
if
_minute
<
0
or
_minute
>
59
:
_minute
=
0
app
.
apscheduler
.
add_job
(
# pylint: disable=no-member
func
=
update_pkg_info
,
id
=
"update_package_data"
,
trigger
=
"cron"
,
hour
=
_hour
,
minute
=
_minute
)
app
.
apscheduler
.
add_job
(
# pylint: disable=no-member
...
...
packageship/packageship/application/apps/lifecycle/function/download_yaml.py
浏览文件 @
1cc17308
...
...
@@ -80,8 +80,8 @@ class ParseYaml():
if
self
.
_openeuler_advisor_exists_yaml
():
self
.
_save_to_database
()
else
:
msg
=
"The yaml information of the
%s package has not been
\
obtained yet"
%
self
.
pkg
.
name
msg
=
"The yaml information of the
[%s] package has not been"
\
"
obtained yet"
%
self
.
pkg
.
name
self
.
base
.
log
.
logger
.
warning
(
msg
)
def
_get_yaml_content
(
self
,
url
):
...
...
@@ -118,15 +118,16 @@ class ParseYaml():
"""
self
.
_parse_warehouse_info
()
tags
=
self
.
_yaml_content
.
get
(
'git_tag'
,
None
)
self
.
_parse_tags_content
(
tags
)
if
tags
:
self
.
_parse_tags_content
(
tags
)
self
.
producer_consumer
.
put
(
copy
.
deepcopy
(
self
.
pkg
))
if
self
.
timed_task_open
:
_maintainer
=
self
.
_yaml_content
.
get
(
'maintainer'
)
_maintainer
=
self
.
_yaml_content
.
get
(
'maintainer
s
'
)
if
_maintainer
and
isinstance
(
_maintainer
,
list
):
self
.
pkg
.
maintainer
=
_maintainer
[
0
]
self
.
pkg
.
maintainlevel
=
self
.
_yaml_content
.
get
(
'maintainlevel'
)
try
:
self
.
producer_consumer
.
put
(
copy
.
deepcopy
(
self
.
pkg
))
if
self
.
timed_task_open
and
self
.
pkg
.
maintainer
:
if
self
.
timed_task_open
:
@
retry
(
stop_max_attempt_number
=
3
,
stop_max_delay
=
500
)
def
_save_maintainer_info
():
with
DBHelper
(
db_name
=
"lifecycle"
)
as
database
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录