Commit c3d20267 authored by 高雅喆's avatar 高雅喆

已读灰度策略下线,问题已读改为10天,回答已读改为永久

parent 7e4c7121
...@@ -224,14 +224,14 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query ...@@ -224,14 +224,14 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
# 失效时间为第二天凌晨3点 # 失效时间为第二天凌晨3点
# if redis_client.ttl(redis_key)<0: # if redis_client.ttl(redis_key)<0:
today = datetime.datetime.strptime(str(datetime.date.today()), "%Y-%m-%d") # today = datetime.datetime.strptime(str(datetime.date.today()), "%Y-%m-%d")
if STRATEGY_TYPE.READ_GRAY in gray_list: # if STRATEGY_TYPE.READ_GRAY in gray_list:
end_day = today + datetime.timedelta(days=10) # end_day = today + datetime.timedelta(days=10)
else: # else:
end_day = today + datetime.timedelta(days=1) # end_day = today + datetime.timedelta(days=1)
nowTime = datetime.datetime.now() # nowTime = datetime.datetime.now()
expire_time = (end_day - nowTime).seconds + 3 * 60 * 60 # expire_time = (end_day - nowTime).seconds + 3 * 60 * 60
redis_client.expire(redis_key, expire_time) # redis_client.expire(redis_key, expire_time)
ret_list = rank_topic_id_list if query is None else ret_data_list ret_list = rank_topic_id_list if query is None else ret_data_list
if usefulrecall != -1: if usefulrecall != -1:
...@@ -285,10 +285,8 @@ def get_home_recommend_pictorial_ids(user_id=-1, device_id="", size=4, gray_list ...@@ -285,10 +285,8 @@ def get_home_recommend_pictorial_ids(user_id=-1, device_id="", size=4, gray_list
redis_field_list = 'have_read_pictorial_list' redis_field_list = 'have_read_pictorial_list'
redis_client.hset(redis_key, redis_field_list, have_read_lin_pictorial_id_list) redis_client.hset(redis_key, redis_field_list, have_read_lin_pictorial_id_list)
today = datetime.datetime.strptime(str(datetime.date.today()), "%Y-%m-%d") today = datetime.datetime.strptime(str(datetime.date.today()), "%Y-%m-%d")
if STRATEGY_TYPE.READ_GRAY in gray_list: # 问题改成10天已读
end_day = today + datetime.timedelta(days=10) end_day = today + datetime.timedelta(days=10)
else:
end_day = today + datetime.timedelta(days=1)
nowTime = datetime.datetime.now() nowTime = datetime.datetime.now()
expire_time = (end_day - nowTime).seconds + 3 * 60 * 60 expire_time = (end_day - nowTime).seconds + 3 * 60 * 60
redis_client.expire(redis_key, expire_time) redis_client.expire(redis_key, expire_time)
......
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