Commit 5ed0796d authored by 谢祁峰's avatar 谢祁峰

Merge branch 'test' of git.wanmeizhensuo.com:alpha/physical into test

parents 9097fb52 7a75873a
......@@ -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:
......
......@@ -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:
......
......@@ -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 = {
......
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