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
alpha
physical
Commits
c3d20267
Commit
c3d20267
authored
Sep 24, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
已读灰度策略下线,问题已读改为10天,回答已读改为永久
parent
7e4c7121
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
topic.py
search/views/topic.py
+9
-11
No files found.
search/views/topic.py
View file @
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
:
# 问题改成10天已读
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
)
...
...
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