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
5ed0796d
Commit
5ed0796d
authored
Oct 18, 2019
by
谢祁峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of git.wanmeizhensuo.com:alpha/physical into test
parents
9097fb52
7a75873a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
topic.py
search/utils/topic.py
+1
-1
topic.py
search/views/topic.py
+4
-4
auto_request.py
vest/request/auto_request.py
+10
-5
No files found.
search/utils/topic.py
View file @
5ed0796d
...
...
@@ -127,7 +127,7 @@ class TopicUtils(object):
user_similar_score_list
=
[],
index_type
=
"topic"
,
routing
=
None
,
attention_tag_list
=
[],
linucb_user_id_list
=
[],
disable_collpase
=
False
,
has_score
=
False
):
"""
:remark:获取首页推荐
帖子
列表
:remark:获取首页推荐
回答
列表
:param user_id:
:param offset:
:param size:
...
...
search/views/topic.py
View file @
5ed0796d
...
...
@@ -123,7 +123,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
size
=
size
-
len
(
useful_topic_id_list
)
have_read_topic_id_list
.
extend
(
useful_topic_id_list
)
# linucb 推荐
帖子
# linucb 推荐
回答
linucb_recommend_tags
=
list
()
if
STRATEGY_TYPE
.
CTR_GRAY
in
gray_list
:
topic_recommend_redis_key
=
"ctr_physical:linucb:topic_recommend:device_id:"
+
str
(
device_id
)
...
...
@@ -138,7 +138,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
if
linucb_recommend_tags
:
linucb_recommend_tags
=
json
.
loads
(
linucb_recommend_tags
)
# linucb 推荐新
帖子
# linucb 推荐新
回答
if
linucb_recommend_tags
:
linucb_recommend_tags_set_tags
=
get_same_tagset_ids
(
linucb_recommend_tags
)
if
underexposure_lin_topic_count
:
...
...
@@ -147,7 +147,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, underexposu
have_read_topic_id_list
.
extend
(
underexposure_lin_topic_ids
)
redis_client
.
publish
(
"new_topic_impression"
,
json
.
dumps
(
underexposure_lin_topic_ids
))
# linucb 推荐老
帖子
# linucb 推荐老
回答
recommend_topic_dict
=
redis_client
.
hgetall
(
topic_recommend_redis_key
)
linucb_recommend_topic_id_list
=
list
()
recommend_topic_list
=
list
()
...
...
@@ -596,7 +596,7 @@ def home_query(device_id="", tag_id=-1, user_id=-1, query="", offset=0, size=10,
def
topic_detail_page_recommend
(
device_id
=
""
,
user_id
=-
1
,
topic_id
=-
1
,
topic_pictorial_id
=-
1
,
topic_user_id
=-
1
,
filter_topic_user_id
=
False
,
offset
=
0
,
size
=
10
,
topic_tag_list
=
[]):
"""
:remark:
帖子
详情页推荐策略,缺少第一个卡片策略
:remark:
回答
详情页推荐策略,缺少第一个卡片策略
:param user_id:
:param topic_id:
:param topic_group_id:
...
...
vest/request/auto_request.py
View file @
5ed0796d
...
...
@@ -115,7 +115,8 @@ def logins(user_id):
return
None
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
},
base
=
QueueOnce
,
once
=
{
'graceful'
:
True
,
'unlock_before_run'
:
True
})
# @shared_task(retry_kwargs={'max_retries': 0}, base=QueueOnce, once={'graceful': True, 'unlock_before_run': True})
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
})
def
click
(
cookies_get
,
id
):
# 点赞
try
:
...
...
@@ -149,7 +150,8 @@ def click(cookies_get, id):
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
},
base
=
QueueOnce
,
once
=
{
'graceful'
:
True
,
'unlock_before_run'
:
True
})
# @shared_task(retry_kwargs={'max_retries': 0}, base=QueueOnce, once={'graceful': True, 'unlock_before_run': True})
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
})
def
reply
(
cookies_get
,
id
,
content
):
try
:
post_dict
=
{
...
...
@@ -273,7 +275,8 @@ def get_comments():
return
None
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
},
base
=
QueueOnce
,
once
=
{
'graceful'
:
True
,
'unlock_before_run'
:
True
})
# @shared_task(retry_kwargs={'max_retries': 0}, base=QueueOnce, once={'graceful': True, 'unlock_before_run': True})
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
})
def
follow
(
cookies_get
,
id
):
try
:
post_dict
=
{
...
...
@@ -439,7 +442,8 @@ def set_reply_to_redis():
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
},
base
=
QueueOnce
,
once
=
{
'graceful'
:
True
,
'unlock_before_run'
:
True
})
# @shared_task(retry_kwargs={'max_retries': 0}, base=QueueOnce, once={'graceful': True, 'unlock_before_run': True})
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
})
def
reply2
(
cookies_get
,
id
,
content
,
replied_id
):
try
:
post_dict
=
{
...
...
@@ -460,7 +464,8 @@ def reply2(cookies_get, id, content, replied_id):
logging
.
error
(
"catch exception,logins:
%
s"
%
traceback
.
format_exc
())
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
},
base
=
QueueOnce
,
once
=
{
'graceful'
:
True
,
'unlock_before_run'
:
True
})
# @shared_task(retry_kwargs={'max_retries': 0}, base=QueueOnce, once={'graceful': True, 'unlock_before_run': True})
@shared_task
(
retry_kwargs
=
{
'max_retries'
:
0
})
def
pictorial_reply
(
cookies_get
,
id
,
content
):
try
:
post_dict
=
{
...
...
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