Commit 620cb26c authored by Kai's avatar Kai

update

parent 9f5e9584
......@@ -271,11 +271,16 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
redis_key = "physical:topic_detail_recommend" + ":device_id:" + device_id + "topic_id:"+str(topic_id)
if offset == 0:
have_read_topic_list = ()
redis_client.hmset(redis_key, have_read_topic_list)
redis_dict = {
"have_read_topic_id": json.dumps(have_read_topic_list)
}
redis_client.hmset(redis_key, redis_dict)
redis_client.expire(redis_key, 60 * 60 * 24)
else:
have_read_topic_redis_data = redis_client.hmget(redis_key)
redis_field_list = [b'have_read_topic_list']
have_read_topic_redis_data = redis_client.hmget(redis_key,redis_field_list)
have_read_topic_list = json.loads(have_read_topic_redis_data) if have_read_topic_redis_data else []
es_cli_obj = ESPerform.get_cli()
have_read_topic_list.append(topic_id)
......@@ -324,8 +329,10 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
# user_recommend_list = TopicUtils.get_recommend_topic_ids(user_id, tag_id=-1, single_size=size, offset=offset, size=size,
# topic_user_id=topic_user_id, current_topic_id=topic_id,
# topic_tag_list=topic_tag_list)
redis_client.hmset(redis_key, have_read_topic_list)
redis_dict = {
"have_read_topic_list": json.dumps(have_read_topic_list),
}
redis_client.hmset(redis_key, redis_dict)
redis_client.expire(redis_key, 60 * 60 * 24)
result_list = []
......
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