Commit 32ce60d1 authored by 段英荣's avatar 段英荣

modify expire time

parent f3a0f8fe
...@@ -196,12 +196,12 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query ...@@ -196,12 +196,12 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
redis_client.hmset(redis_key, redis_dict) redis_client.hmset(redis_key, redis_dict)
# 失效时间为第二天凌晨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")
tomorrow = today + datetime.timedelta(days=1) tomorrow = today + datetime.timedelta(days=1)
nowTime = datetime.datetime.now() nowTime = datetime.datetime.now()
expire_time = (tomorrow - nowTime).seconds + 3*60*60 expire_time = (tomorrow - 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:
......
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