Commit 556ffe09 authored by Kai's avatar Kai

update

parent fd5b7df5
...@@ -108,8 +108,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query ...@@ -108,8 +108,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
linucb_recommend_topic_id_list = json.loads(recommend_topic_dict[b"data"]) linucb_recommend_topic_id_list = json.loads(recommend_topic_dict[b"data"])
# 推荐帖子是强插的,要保证推荐帖子不在已读里 # 推荐帖子是强插的,要保证推荐帖子不在已读里
if have_read_topic_id_list == None:
have_read_topic_id_list = list()
recommend_topic_id_list = list(set(linucb_recommend_topic_id_list) - set(have_read_topic_id_list)) recommend_topic_id_list = list(set(linucb_recommend_topic_id_list) - set(have_read_topic_id_list))
recommend_topic_id_list.sort(key=linucb_recommend_topic_id_list.index) recommend_topic_id_list.sort(key=linucb_recommend_topic_id_list.index)
...@@ -160,8 +159,6 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query ...@@ -160,8 +159,6 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
# topic_id_list.extend(recommend_topic_list[3:6]) # topic_id_list.extend(recommend_topic_list[3:6])
# else: # else:
# topic_id_list.extend(rank_topic_id_list) # topic_id_list.extend(rank_topic_id_list)
if have_read_topic_id_list == None:
have_read_topic_id_list = list()
have_read_topic_id_list.extend(rank_topic_id_list) have_read_topic_id_list.extend(rank_topic_id_list)
if len(have_read_topic_id_list) > 30000: if len(have_read_topic_id_list) > 30000:
cut_len = len(have_read_topic_id_list)-30000 cut_len = len(have_read_topic_id_list)-30000
......
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