From d88170519302f8c310411989f04d4cd560c5f355 Mon Sep 17 00:00:00 2001 From: "13621160019@163.com" <13621160019@163.com> Date: Thu, 24 Mar 2022 18:13:15 +0800 Subject: [PATCH] moved cursor.close before cnx.close in myems aggregation service --- myems-aggregation/space_billing_input_category.py | 12 ++++++------ myems-aggregation/space_billing_input_item.py | 12 ++++++------ myems-aggregation/space_billing_output_category.py | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/myems-aggregation/space_billing_input_category.py b/myems-aggregation/space_billing_input_category.py index 410c4f26..fc71ea70 100644 --- a/myems-aggregation/space_billing_input_category.py +++ b/myems-aggregation/space_billing_input_category.py @@ -249,20 +249,20 @@ def main(logger): break # end of for space loop - if cnx_system_db: - cnx_system_db.close() if cursor_system_db: cursor_system_db.close() + if cnx_system_db: + cnx_system_db.close() - if cnx_energy_db: - cnx_energy_db.close() if cursor_energy_db: cursor_energy_db.close() + if cnx_energy_db: + cnx_energy_db.close() - if cnx_billing_db: - cnx_billing_db.close() if cursor_billing_db: cursor_billing_db.close() + if cnx_billing_db: + cnx_billing_db.close() print("go to sleep 300 seconds...") time.sleep(300) print("wake from sleep, and continue to work...") diff --git a/myems-aggregation/space_billing_input_item.py b/myems-aggregation/space_billing_input_item.py index 1fa53a36..aa89d2a8 100644 --- a/myems-aggregation/space_billing_input_item.py +++ b/myems-aggregation/space_billing_input_item.py @@ -249,20 +249,20 @@ def main(logger): break # end of for space loop - if cnx_system_db: - cnx_system_db.close() if cursor_system_db: cursor_system_db.close() + if cnx_system_db: + cnx_system_db.close() - if cnx_energy_db: - cnx_energy_db.close() if cursor_energy_db: cursor_energy_db.close() + if cnx_energy_db: + cnx_energy_db.close() - if cnx_billing_db: - cnx_billing_db.close() if cursor_billing_db: cursor_billing_db.close() + if cnx_billing_db: + cnx_billing_db.close() print("go to sleep 300 seconds...") time.sleep(300) print("wake from sleep, and continue to work...") diff --git a/myems-aggregation/space_billing_output_category.py b/myems-aggregation/space_billing_output_category.py index 09bc005f..d059fd91 100644 --- a/myems-aggregation/space_billing_output_category.py +++ b/myems-aggregation/space_billing_output_category.py @@ -249,20 +249,20 @@ def main(logger): break # end of for space loop - if cnx_system_db: - cnx_system_db.close() if cursor_system_db: cursor_system_db.close() + if cnx_system_db: + cnx_system_db.close() - if cnx_energy_db: - cnx_energy_db.close() if cursor_energy_db: cursor_energy_db.close() + if cnx_energy_db: + cnx_energy_db.close() - if cnx_billing_db: - cnx_billing_db.close() if cursor_billing_db: cursor_billing_db.close() + if cnx_billing_db: + cnx_billing_db.close() print("go to sleep 300 seconds...") time.sleep(300) print("wake from sleep, and continue to work...")