Commit 46f936c1 authored by 张彦钊's avatar 张彦钊

change sql for test

parent 1da4f2ad
......@@ -14,6 +14,20 @@ import time
from userProfile import get_active_users
import os
def get_video_id():
db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle')
cursor = db.cursor()
sql = "select diary_id from feed_diary_boost;"
cursor.execute(sql)
result = cursor.fetchall()
df = pd.DataFrame(list(result))
video_id = df[0].values.tolist()
print(video_id[:10])
db.close()
return video_id
def test_con_sql(device_id):
db = pymysql.connect(host='rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com', port=3306, user='doris',
passwd='o5gbA27hXHHm', db='doris_prod')
......@@ -160,11 +174,13 @@ def merge_score(x_list, score_df):
def update_dairy_queue(score_df):
diary_id = score_df["cid"].values.tolist()
video_id = []
x = 1
while x < len(diary_id):
video_id.append(diary_id[x])
x += 5
all_video_id = get_video_id()
video_id = list(set(all_video_id)&set(diary_id))
# x = 1
# while x < len(diary_id):
# video_id.append(diary_id[x])
# x += 5
if len(video_id)>0:
not_video_id = list(set(diary_id) - set(video_id))
not_video_id_df = score_df.loc[score_df["cid"].isin(not_video_id)]
......
......@@ -3,7 +3,7 @@ import pymysql
import pandas as pd
DIRECTORY_PATH = '/data2/models/'
def con_sql():
def get_video_id():
db = pymysql.connect(host='10.66.157.22', port=4000, user='root', passwd='3SYz54LS9#^9sBvC', db='eagle')
cursor = db.cursor()
sql = "select diary_id from feed_diary_boost;"
......@@ -30,7 +30,7 @@ def queue():
if __name__=="__main__":
all = queue()
video = con_sql()
video = get_video_id()
video_id = []
x = 1
while x < len(all):
......
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