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
ab74ef6f
Commit
ab74ef6f
authored
Sep 24, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gyz' into 'master'
已读灰度策略下线,问题已读改为10天,回答已读改为永久 See merge request
!492
parents
7e4c7121
c3d20267
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
topic.py
search/views/topic.py
+10
-12
No files found.
search/views/topic.py
View file @
ab74ef6f
...
...
@@ -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
)
...
...
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