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

modify

parent 8aa90ee9
......@@ -58,7 +58,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
redis_field_list = [b'have_read_topic_list']
redis_field_val_list = redis_client.hmget(redis_key, redis_field_list)
tag_recommend_redis_key = "physical:linucb:tag_recommend:device_id:" + str(device_id)
topic_recommend_redis_key = "physical:linucb:topic_recommend:device_id:" + str(device_id)
# recommend_tag_dict = dict()
......@@ -67,10 +67,10 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
# recommend_tag_dict = json.loads(str(tag_recommend_val, encoding="utf-8"))
recommend_topic_list=list()
recommend_tag_dict = redis_client.hgetall(tag_recommend_redis_key)
if "data" in recommend_tag_dict:
recommend_topic_id_list = json.loads(recommend_tag_dict["data"])
cursor = recommend_tag_dict["cursor"]
recommend_topic_dict = redis_client.hgetall(topic_recommend_redis_key)
if "data" in recommend_topic_dict:
recommend_topic_id_list = json.loads(recommend_topic_dict["data"])
cursor = recommend_topic_dict["cursor"]
if len(recommend_topic_id_list) > (cursor+5):
recommend_topic_list = recommend_topic_id_list[cursor:cursor+5]
......
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