Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
44a6b487
Commit
44a6b487
authored
Aug 29, 2018
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print
parent
42c887d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
diaryQueueUpdate.py
diaryQueueUpdate.py
+24
-0
utils.py
utils.py
+3
-2
No files found.
diaryQueueUpdate.py
View file @
44a6b487
...
...
@@ -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'
)
...
...
utils.py
View file @
44a6b487
...
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment