Commit 4d953aca authored by 高雅喆's avatar 高雅喆

画像增量存储

parent 10f3a656
......@@ -104,8 +104,9 @@ def get_user_service_portrait(cl_id, all_word_tags, all_tag_tag_type, all_3tag_2
# 写tidb,redis同步
stat_date = datetime.datetime.today().strftime('%Y-%m-%d')
replace_sql = """replace into user_service_portrait_tags (stat_date, cl_id, tag_list) values("{stat_date}","{cl_id}","{tag_list}")"""\
.format(stat_date=stat_date, cl_id=cl_id, tag_list=gmkv_tag_score_sum)
gmkv_tag_score3_sum_dict = sorted(gmkv_tag_score3_sum_dict.items(), key=lambda i: i[1], reverse=True)[:5]
replace_sql = """insert into user_service_portrait_tags (stat_date, cl_id, portrait_tag_list) values("{stat_date}","{cl_id}","{portrait_tag_list}")"""\
.format(stat_date=stat_date, cl_id=cl_id, portrait_tag_list=gmkv_tag_score3_sum_dict)
cur_jerry_test.execute(replace_sql)
db_jerry_test.commit()
cur_jerry_test.close()
......
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