李莎 hace 2 años
padre
commit
f6a25fd402
Se han modificado 2 ficheros con 7 adiciones y 4 borrados
  1. 1 0
      main.py
  2. 6 4
      temp_main.py

+ 1 - 0
main.py

@@ -99,3 +99,4 @@ while True:
         else:
             time.sleep(2)
             print("%s,等待下次程序执行" % (datetime_now()))
+        MysqlUtil.close()

+ 6 - 4
temp_main.py

@@ -66,14 +66,15 @@ time_now = datetime.datetime.fromtimestamp(int(time.time()),
 start_time = "20221201000000"
 end_time = "20230110000000"
 range_days = get_day(start_time,end_time)
+# #连接hbase
+zillionUtil = ZillionUtil(url)
+# #连接hbase
+MysqlUtil = MysqlUtils(**mysql)
 for i in range_days:
     yesterday, today = i[0], i[1]
     yesterday = yesterday[0:8]
     today = today[0:8]
-    # #连接hbase
-    zillionUtil = ZillionUtil(url)
-    # #连接hbase
-    MysqlUtil = MysqlUtils(**mysql)
+
     for building in buildings:
         pointlists = get_pointlists(zillionUtil,hbase_database,"dy_pointlist",building)
         meters_10101 = []
@@ -106,3 +107,4 @@ for i in range_days:
     else:
         time.sleep(2)
         print("%s,等待下次程序执行" % (datetime_now()))
+MysqlUtil.close()