Commit 877ac1ae authored by 张彦钊's avatar 张彦钊

add test

parent 88c29c33
...@@ -291,7 +291,12 @@ def multi_proecess_update(device_id, city_id, data_set_cid,total_video_id): ...@@ -291,7 +291,12 @@ def multi_proecess_update(device_id, city_id, data_set_cid,total_video_id):
if __name__ == "__main__": if __name__ == "__main__":
warnings.filterwarnings("ignore") warnings.filterwarnings("ignore")
flag = True
path = DIRECTORY_PATH
# 下面这个ip是本地电脑ip
if socket.gethostbyname(socket.gethostname()) == '172.30.8.160':
flag = False
path = LOCAL_DIRCTORY
# 增加缓存日记视频列表 # 增加缓存日记视频列表
cache_video_id = [] cache_video_id = []
cache_device_city_list = [] cache_device_city_list = []
......
...@@ -59,26 +59,30 @@ def save_queue(): ...@@ -59,26 +59,30 @@ def save_queue():
df.to_csv("/data/models/{}.csv".format(i), index=None) df.to_csv("/data/models/{}.csv".format(i), index=None)
print("end") print("end")
# def insert(): def insert(id,device_id,city_id):
# queue_name_list = ["native_queue", "nearby_queue", "nation_queue", "megacity_queue"] queue_name_list = ["native_queue", "nearby_queue", "nation_queue", "megacity_queue"]
# a = {} a = {}
# for i in queue_name_list: for i in queue_name_list:
# a[i] = pd.read_csv("/data/models/native_queue.csv")["0"].values.tolist()[0] a[i] = pd.read_csv("/data/models/native_queue.csv")["0"].values.tolist()[0]
# # columns = ["native_queue", "nearby_queue", "nation_queue", "megacity_queue","id","device_id","city_id"]
# db = pymysql.connect(host='rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com', port=3306, user='doris', db = pymysql.connect(host='rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com', port=3306, user='doris',
# passwd='o5gbA27hXHHm', passwd='o5gbA27hXHHm',
# db='doris_prod') db='doris_prod')
# sql = "update device_diary_queue set {}='{}' where device_id = '{}' and city_id = '{}'".format \ sql = "INSERT INTO device_diary_queue (native_queue, nearby_queue, nation_queue, " \
# (i, a[i], device_id, city_id) "megacity_queue,id,device_id,city_id) VALUES ('{}','{}','{}','{}','{}','{}','{}');".format \
# cursor = db.cursor() (a["native_queue"], a["nearby_queue"],a["nation_queue"], a["megacity_queue"],id,device_id, city_id)
# cursor.execute(sql) cursor = db.cursor()
# db.commit() cursor.execute(sql)
# db.close() db.commit()
# print("end") db.close()
print("end")
if __name__=="__main__": if __name__=="__main__":
save_queue() id = 334
device_id = '00CA20EB-2719-4518-85CC-60E765AC526F'
city_id = 'beijing'
insert(id, device_id, city_id)
......
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