Commit e8cdc8f7 authored by 臧远慧's avatar 臧远慧

Merge branch 'mr/beta/73909' into 'master'

增加zhengxing_table_list

See merge request !11
parents 05ed68fe 0b39a44d
...@@ -3,7 +3,6 @@ import psycopg2 ...@@ -3,7 +3,6 @@ import psycopg2
import pymysql import pymysql
from dingtalkchatbot.chatbot import DingtalkChatbot from dingtalkchatbot.chatbot import DingtalkChatbot
DATABASES = { DATABASES = {
'slave': { # mysql 'slave': { # mysql
'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.mysql',
...@@ -29,11 +28,11 @@ def main(): ...@@ -29,11 +28,11 @@ def main():
pg_cursor = pg_db.cursor() pg_cursor = pg_db.cursor()
zhengxing_table_list = ["api_city", "api_province", "auth_user", "api_userextra", "api_userblacklist", zhengxing_table_list = ["api_city", "api_province", "auth_user", "api_userextra", "api_userblacklist",
"api_userextratocollege", "api_userextratocollege", "api_area", "doctor_doctorstafflogin", "hippo_merchant",
"api_doctor", "api_person", "social_userfollow", "api_userinnerinfo", "api_hospital", "api_doctor", "api_person", "social_userfollow", "api_userinnerinfo", "api_hospital",
"statistic_device", "statistic_device", "hippo_chain_merchant_master", "hippo_merchantrelevance",
"statistic_device_user", "statistic_shequdevice", "statistic_device_package_info"] "hippo_merchantrelevance", "statistic_device_user", "statistic_shequdevice",
"statistic_device_package_info"]
msg = "数据同步监控, 有{}张表在同步\n".format(len(zhengxing_table_list)) msg = "数据同步监控, 有{}张表在同步\n".format(len(zhengxing_table_list))
...@@ -57,7 +56,8 @@ def main(): ...@@ -57,7 +56,8 @@ def main():
print(table, my_num, pg_num) print(table, my_num, pg_num)
if my_num > pg_num: if my_num > pg_num:
delay_table_num += 1 delay_table_num += 1
msg += "zhengxing.{}延迟的数据量为{}条记录, \nmysql: {}, \npgsql: {};\n".format(table, my_num - pg_num, my_num, str(pg_num)) msg += "zhengxing.{}延迟的数据量为{}条记录, \nmysql: {}, \npgsql: {};\n".format(table, my_num - pg_num, my_num,
str(pg_num))
if delay_table_num > 0: if delay_table_num > 0:
msg += "有{}张表存在延迟".format(delay_table_num) msg += "有{}张表存在延迟".format(delay_table_num)
......
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