Commit bcdcc23e authored by 段英荣's avatar 段英荣

modify

parent 93354e84
...@@ -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 = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment