Commit 3cb6e0e7 authored by 段英荣's avatar 段英荣

modify

parent b924a5ef
...@@ -20,6 +20,7 @@ class PickUtils(object): ...@@ -20,6 +20,7 @@ class PickUtils(object):
valid_seconds = int((end_time - now).seconds) valid_seconds = int((end_time - now).seconds)
logging.info("duan add,have_read_celebrity_list:%s" % str(have_read_celebrity_list))
redis_cli.setex(redis_key,valid_seconds,json.dumps(have_read_celebrity_list)) redis_cli.setex(redis_key,valid_seconds,json.dumps(have_read_celebrity_list))
return True return True
......
...@@ -102,6 +102,8 @@ def pick_topic(user_id,pick_id,offset=0,size=10): ...@@ -102,6 +102,8 @@ def pick_topic(user_id,pick_id,offset=0,size=10):
recommend_pick_topic_list = [item["_source"]["id"] for item in result_dict["hits"]] recommend_pick_topic_list = [item["_source"]["id"] for item in result_dict["hits"]]
if len(recommend_pick_topic_list) > 0: if len(recommend_pick_topic_list) > 0:
logging.info("duan add,[:%s,%s]" % (str(have_read_pick_topic_ids),str(recommend_pick_topic_list)))
PickUtils.refresh_redis_data(have_read_celebrity_list=have_read_pick_topic_ids.extend(recommend_pick_topic_list), PickUtils.refresh_redis_data(have_read_celebrity_list=have_read_pick_topic_ids.extend(recommend_pick_topic_list),
redis_cli=redis_client,redis_key=redis_key) redis_cli=redis_client,redis_key=redis_key)
......
...@@ -17,7 +17,6 @@ def home_recommend(user_id=-1,offset=0,size=10): ...@@ -17,7 +17,6 @@ def home_recommend(user_id=-1,offset=0,size=10):
:return: :return:
""" """
try: try:
#logging.info("duan add,ctx:%s" % str(ctx))
if not user_id: if not user_id:
user_id=-1 user_id=-1
redis_key = "physical:home_recommend:" + "user_id:" + str(user_id) redis_key = "physical:home_recommend:" + "user_id:" + str(user_id)
......
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