Commit bccc034d authored by 赵威's avatar 赵威

try 60 days

parent b53ea604
......@@ -219,30 +219,28 @@ def update_tag3_user_portrait(cl_id):
second_solutions_score = merge_values(second_solutions_list)
first_positions_score = merge_values(first_positions_list)
second_positions_score = merge_values(second_positions_list)
projects_score = merge_values(projects_list)
# projects_score_tmp = merge_values(projects_list)
# tmp = [
# "不感兴趣", "没有想法", "八卦来了", "颜值速报", "医美审美干货", "其他项目", "网红颜值", "少年之名", "郑人予", "热点课代表", "私密", "陈瑞泽", "符仁杰", "祖力亚尔", "刘泽旭",
# "陈家瑨", "娱乐八卦", "美白1", "情感", "颜安", "苏勋伦", "丰唇1", "牙齿矫正", "无创溶脂"
# ]
# forbidden_lst = ["无创溶脂kyc"]
# for i in tmp:
# forbidden_lst.append(i + "kyc")
# forbidden_lst.extend(tmp)
# # forbidden_set = set(forbidden_lst)
# forbidden_set = set()
# projects_score = {}
# for (k, v) in projects_score_tmp.items():
# if k not in forbidden_set:
# projects_score[k] = v
# tmp_res = {}
# if (len(first_demands_score) == 0) and (len(first_solutions_score) == 0) and (len(first_positions_score) == 0) and (
# len(second_demands_score) == 0) and (len(second_solutions_score) == 0) and (len(second_positions_score) == 0):
# tmp_res = _get_all_by_projects(list(projects_score.keys()))
# projects_score = merge_values(projects_list)
projects_score_tmp = merge_values(projects_list)
tmp = [
"不感兴趣", "没有想法", "八卦来了", "颜值速报", "医美审美干货", "其他项目", "网红颜值", "少年之名", "郑人予", "热点课代表", "私密", "陈瑞泽", "符仁杰", "祖力亚尔", "刘泽旭",
"陈家瑨", "娱乐八卦", "美白1", "情感", "颜安", "苏勋伦", "丰唇1", "牙齿矫正", "无创溶脂"
]
forbidden_lst = ["无创溶脂kyc"]
for i in tmp:
forbidden_lst.append(i + "kyc")
forbidden_lst.extend(tmp)
forbidden_set = set(forbidden_lst)
projects_score = {}
for (k, v) in projects_score_tmp.items():
if k not in forbidden_set:
projects_score[k] = v
tmp_res = {}
if (len(first_demands_score) == 0) and (len(first_solutions_score) == 0) and (len(first_positions_score) == 0) and (
len(second_demands_score) == 0) and (len(second_solutions_score) == 0) and (len(second_positions_score) == 0):
tmp_res = _get_all_by_projects(list(projects_score.keys()))
res = {
"first_demands": first_demands_score,
......@@ -253,8 +251,8 @@ def update_tag3_user_portrait(cl_id):
"second_positions": second_positions_score,
"projects": projects_score
}
# if tmp_res:
# res.update(tmp_res)
if tmp_res:
res.update(tmp_res)
key = "doris:user_portrait:tag3:device_id:" + str(cl_id)
redis_client = redis.StrictRedis.from_url("redis://:ReDis!GmTx*0aN9@172.16.40.173:6379")
......@@ -280,7 +278,7 @@ def update_tag3_user_portrait(cl_id):
def consume_kafka():
sql = "select distinct cl_id from kafka_tag3_log where log_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 30 day))"
sql = "select distinct cl_id from kafka_tag3_log where log_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 60 day))"
db, cursor = get_doris_prod()
cursor.execute(sql)
device_ids_lst = [i[0] for i in cursor.fetchall()]
......
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