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

Merge branch 'gyz' into 'master'

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

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