Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
physical
Commits
d15d7bd9
Commit
d15d7bd9
authored
Oct 21, 2019
by
谢祁峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
01f2957b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
collect_data.py
linucb/views/collect_data.py
+14
-6
No files found.
linucb/views/collect_data.py
View file @
d15d7bd9
...
...
@@ -629,19 +629,22 @@ class CollectData(object):
str
(
tag_query_results_multi
)))
# 首页搜索精准匹配标签关键字进linucb
elif
'SYS'
in
data
and
'APP'
in
data
and
'action'
in
data
[
'SYS'
]
and
\
"api/v1/cards/topic"
in
data
[
'SYS'
][
'action'
]:
"api/v1/cards/topic"
in
str
(
data
[
'SYS'
]
.
get
(
'action'
,
""
)):
logging
.
info
(
"action=api/v1/cards/topic"
)
tag_name
=
data
[
"APP"
]
.
get
(
"query"
,
[])
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
tag
=
tag_name
)
.
values_list
(
"id"
))
name
=
tag_name
)
.
values_list
(
"id"
))
device_id
=
data
[
"SYS"
][
"cl_id"
]
user_id
=
data
[
'SYS'
]
.
get
(
'user_id'
,
None
)
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
tag_list
,
5
)
logging
.
info
(
"api/v1/cards/topic,device_id:
%
s,tag_list:
%
s"
%
(
str
(
device_id
),
str
(
tag_list
)))
# (客户端创建回答,后台创建回答或修改回答关联标签关键字进linucb
elif
'SYS'
in
data
and
'APP'
in
data
and
'action'
in
data
[
'SYS'
]
and
\
(
"venus/community/topic/create"
in
data
[
'SYS'
][
'action'
]
or
"venus/sun/topic/edit"
in
data
[
'SYS'
][
'action'
]):
(
"venus/community/topic/create"
in
str
(
data
[
'SYS'
]
.
get
(
'action'
,
""
))
or
"venus/sun/topic/edit"
in
str
(
data
[
'SYS'
]
.
get
(
'action'
,
""
))):
logging
.
info
(
"action=venus/community/topic/create"
)
tag_ids
=
list
(
data
[
"APP"
]
.
get
(
"tag_ids"
,
[]))
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
id__in
=
tag_ids
,
is_online
=
True
,
is_deleted
=
False
,
...
...
@@ -651,9 +654,13 @@ class CollectData(object):
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
tag_list
,
10
)
logging
.
info
(
"venus/community/topic/create,device_id:
%
s,tag_list:
%
s"
%
(
str
(
device_id
),
str
(
tag_list
)))
# 创建问题关注标签关键字进linucb
elif
'SYS'
in
data
and
'APP'
in
data
and
'action'
in
data
[
'SYS'
]
and
\
"venus/sun/pictorial/edit"
in
data
[
'SYS'
][
'action'
]:
"venus/sun/pictorial/edit"
in
str
(
data
[
'SYS'
]
.
get
(
'action'
,
""
)):
logging
.
info
(
"action=venus/sun/pictorial/edit"
)
tag_ids
=
list
(
data
[
"APP"
]
.
get
(
"tag_ids"
,
[]))
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
id__in
=
tag_ids
,
is_online
=
True
,
is_deleted
=
False
,
...
...
@@ -663,6 +670,8 @@ class CollectData(object):
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
tag_list
,
20
)
logging
.
info
(
"venus/sun/pictorial/edit,device_id:
%
s,tag_list:
%
s"
%
(
str
(
device_id
),
str
(
tag_list
)))
else
:
if
msg
:
logging
.
warning
(
...
...
@@ -672,7 +681,6 @@ class CollectData(object):
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
# 假设数据库连接异常,强制退出程序,supervisor重启linub
os
.
_exit
(
0
)
return
True
except
:
logging_exception
()
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment