Commit 44a6b487 authored by 张彦钊's avatar 张彦钊

add print

parent 42c887d9
......@@ -174,6 +174,30 @@ def update_sql_dairy_queue(queue_name, diary_id,device_id, city_id):
print("成功写入diary_id")
# def queue_compare(old_list, new_list):
# # 去掉前面的"diary|"
# old_list = list(map(lambda x: int(x[6:]),old_list))
# # print("旧表前十个")
# # print(old_list[:10])
# # print("新表前十个")
# # print(new_list[:10])
# temp = list(range(len(old_list)))
# x_dict = dict(zip(old_list, temp))
# temp = list(range(len(new_list)))
# y_dict = dict(zip(new_list, temp))
# i = 0
# for key in x_dict.keys():
# if x_dict[key] != y_dict[key]:
# i += 1
# global update_queue_numbers
# print("更新日记队列总数:{}".format(update_queue_numbers))
# if i >0:
# update_queue_numbers += 1
# print("更新日记队列总数:{}".format(update_queue_numbers))
# print("日记队列更新前日记总个数{},位置发生变化个数{},发生变化率{}%".format(len(old_list), i,
# round(i / len(old_list) * 100), 2))
def get_queue(device_id, city_id,queue_name):
db = pymysql.connect(host='rm-m5e842126ng59jrv6.mysql.rds.aliyuncs.com', port=3306, user='doris',
passwd='o5gbA27hXHHm', db='doris_prod')
......
......@@ -55,6 +55,8 @@ def queue_compare(old_list, new_list):
# print(old_list[:10])
# print("新表前十个")
# print(new_list[:10])
global update_queue_numbers
print("更新日记队列总数:{}".format(update_queue_numbers))
temp = list(range(len(old_list)))
x_dict = dict(zip(old_list, temp))
temp = list(range(len(new_list)))
......@@ -63,8 +65,7 @@ def queue_compare(old_list, new_list):
for key in x_dict.keys():
if x_dict[key] != y_dict[key]:
i += 1
global update_queue_numbers
print("更新日记队列总数:{}".format(update_queue_numbers))
if i >0:
update_queue_numbers += 1
print("更新日记队列总数:{}".format(update_queue_numbers))
......
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