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
bcdcc23e
Commit
bcdcc23e
authored
Apr 01, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
93354e84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
collect_data.py
linucb/views/collect_data.py
+6
-4
No files found.
linucb/views/collect_data.py
View file @
bcdcc23e
...
@@ -118,10 +118,12 @@ class CollectData(object):
...
@@ -118,10 +118,12 @@ class CollectData(object):
tag_topic_id_list
=
self
.
get_tag_topic_list
(
tag_id
)
tag_topic_id_list
=
self
.
get_tag_topic_list
(
tag_id
)
redis_client
.
set
(
redis_tag_id_key
,
json
.
dumps
(
tag_topic_id_list
))
redis_client
.
set
(
redis_tag_id_key
,
json
.
dumps
(
tag_topic_id_list
))
redis_client
.
expire
(
redis_tag_id_key
,
1
*
24
*
60
*
60
)
redis_client
.
expire
(
redis_tag_id_key
,
1
*
24
*
60
*
60
)
for
topic_id
in
tag_topic_id_list
:
if
topic_id
not
in
have_read_topic_id_list
:
if
len
(
tag_topic_id_list
)
>
index
:
recommend_topic_id_list
.
append
(
topic_id
)
for
topic_id
in
tag_topic_id_list
[
index
:]:
break
if
topic_id
not
in
have_read_topic_id_list
:
recommend_topic_id_list
.
append
(
topic_id
)
break
topic_recommend_redis_key
=
self
.
linucb_recommend_topic_id_prefix
+
str
(
device_id
)
topic_recommend_redis_key
=
self
.
linucb_recommend_topic_id_prefix
+
str
(
device_id
)
redis_data_dict
=
{
redis_data_dict
=
{
...
...
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