Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
physical
Commits
32ce60d1
Commit
32ce60d1
authored
Aug 18, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify expire time
parent
f3a0f8fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
topic.py
search/views/topic.py
+6
-6
No files found.
search/views/topic.py
View file @
32ce60d1
...
...
@@ -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
)
# 失效时间为第二天凌晨3点
if
redis_client
.
ttl
(
redis_key
)
<
0
:
today
=
datetime
.
datetime
.
strptime
(
str
(
datetime
.
date
.
today
()),
"
%
Y-
%
m-
%
d"
)
tomorrow
=
today
+
datetime
.
timedelta
(
days
=
1
)
nowTime
=
datetime
.
datetime
.
now
()
expire_time
=
(
tomorrow
-
nowTime
)
.
seconds
+
3
*
60
*
60
redis_client
.
expire
(
redis_key
,
expire_time
)
#
if redis_client.ttl(redis_key)<0:
today
=
datetime
.
datetime
.
strptime
(
str
(
datetime
.
date
.
today
()),
"
%
Y-
%
m-
%
d"
)
tomorrow
=
today
+
datetime
.
timedelta
(
days
=
1
)
nowTime
=
datetime
.
datetime
.
now
()
expire_time
=
(
tomorrow
-
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment