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
d366ed78
Commit
d366ed78
authored
Apr 18, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.wanmeizhensuo.com:alpha/physical
parents
67ddbf21
f33f03b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
collect_data.py
linucb/views/collect_data.py
+11
-3
No files found.
linucb/views/collect_data.py
View file @
d366ed78
...
@@ -103,7 +103,14 @@ class CollectData(object):
...
@@ -103,7 +103,14 @@ class CollectData(object):
if
len
(
recommend_topic_id_list
)
==
0
and
cursor
==
0
and
len
(
redis_topic_list
)
>
0
:
if
len
(
recommend_topic_id_list
)
==
0
and
cursor
==
0
and
len
(
redis_topic_list
)
>
0
:
have_read_topic_id_list
.
extend
(
redis_topic_list
[:
2
])
have_read_topic_id_list
.
extend
(
redis_topic_list
[:
2
])
tag_topic_id_list
=
ESPerform
.
get_tag_topic_list
(
tag_id_list
,
have_read_topic_id_list
)
if
len
(
tag_id_list
)
>
0
:
if
len
(
new_user_click_tag_list
)
>
0
:
tag_topic_id_list
=
ESPerform
.
get_tag_topic_list
(
new_user_click_tag_list
,
have_read_topic_id_list
)
logging
.
warning
(
"tag_topic_id_list:
%
s"
%
str
(
new_user_click_tag_list
))
logging
.
warning
(
"tag_id_list:
%
s"
%
str
(
tag_id_list
))
else
:
tag_topic_id_list
=
ESPerform
.
get_tag_topic_list
(
tag_id_list
,
have_read_topic_id_list
)
if
len
(
recommend_topic_id_list
)
>
0
or
len
(
new_user_click_tag_list
)
>
0
:
if
len
(
recommend_topic_id_list
)
>
0
or
len
(
new_user_click_tag_list
)
>
0
:
tag_topic_id_list
=
recommend_topic_id_list
+
tag_topic_id_list
tag_topic_id_list
=
recommend_topic_id_list
+
tag_topic_id_list
...
@@ -195,7 +202,7 @@ class CollectData(object):
...
@@ -195,7 +202,7 @@ class CollectData(object):
exposure_cards_list
=
list
()
exposure_cards_list
=
list
()
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
logging
.
warning
(
"type msg:
%
s"
%
raw_val_dict
.
get
(
"type"
))
exposure_topic_id_list
=
list
()
exposure_topic_id_list
=
list
()
for
item
in
exposure_cards_list
:
for
item
in
exposure_cards_list
:
if
"card_id"
not
in
item
:
if
"card_id"
not
in
item
:
...
@@ -243,8 +250,9 @@ class CollectData(object):
...
@@ -243,8 +250,9 @@ class CollectData(object):
tagid_list
=
raw_val_dict
[
"params"
][
"tagid_list"
]
tagid_list
=
raw_val_dict
[
"params"
][
"tagid_list"
]
else
:
else
:
tagid_list
=
list
()
tagid_list
=
list
()
logging
.
warning
(
"unknown type msg:
%
s"
%
raw_val_dict
.
get
(
"type"
,
"missing type"
))
logging
.
info
(
logging
.
info
(
"consume topic_id:
%
s,device_id:
%
s"
%
(
"consume
click
topic_id:
%
s,device_id:
%
s"
%
(
str
(
tagid_list
),
str
(
device_id
)))
str
(
tagid_list
),
str
(
device_id
)))
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
device_id
=
raw_val_dict
[
"device"
][
"device_id"
]
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
user_id
=
raw_val_dict
[
"user_id"
]
if
"user_id"
in
raw_val_dict
else
None
...
...
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