From 0122ece16fe8e30594a03a5b27124ab57bca0d53 Mon Sep 17 00:00:00 2001 From: "13621160019@163.com" <13621160019@163.com> Date: Sun, 14 Mar 2021 17:50:45 +0800 Subject: [PATCH] fixed Cursor is not connected issues in combined equipment procedures in aggregation --- .../combined_equipment_energy_input_category.py | 5 ++--- myems-aggregation/combined_equipment_energy_input_item.py | 5 ++--- .../combined_equipment_energy_output_category.py | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/myems-aggregation/combined_equipment_energy_input_category.py b/myems-aggregation/combined_equipment_energy_input_category.py index b03a93eb..bbca4468 100644 --- a/myems-aggregation/combined_equipment_energy_input_category.py +++ b/myems-aggregation/combined_equipment_energy_input_category.py @@ -207,13 +207,12 @@ def worker(combined_equipment): except Exception as e: error_string = "Error in step 3.1 of combined_equipment_energy_input_category.worker " + str(e) - print(error_string) - return error_string - finally: if cursor_system_db: cursor_system_db.close() if cnx_system_db: cnx_system_db.close() + print(error_string) + return error_string #################################################################################################################### # Step 4: get all equipments associated with the combined equipment diff --git a/myems-aggregation/combined_equipment_energy_input_item.py b/myems-aggregation/combined_equipment_energy_input_item.py index 570b4bf5..ccb7b557 100644 --- a/myems-aggregation/combined_equipment_energy_input_item.py +++ b/myems-aggregation/combined_equipment_energy_input_item.py @@ -210,13 +210,12 @@ def worker(combined_equipment): except Exception as e: error_string = "Error in step 3.1 of combined_equipment_energy_input_item.worker " + str(e) - print(error_string) - return error_string - finally: if cursor_system_db: cursor_system_db.close() if cnx_system_db: cnx_system_db.close() + print(error_string) + return error_string #################################################################################################################### # Step 4: get all equipments associated with the combined equipment diff --git a/myems-aggregation/combined_equipment_energy_output_category.py b/myems-aggregation/combined_equipment_energy_output_category.py index d3aa50ff..7eb7acc8 100644 --- a/myems-aggregation/combined_equipment_energy_output_category.py +++ b/myems-aggregation/combined_equipment_energy_output_category.py @@ -207,13 +207,12 @@ def worker(combined_equipment): except Exception as e: error_string = "Error in step 3.1 of combined_equipment_energy_output_category.worker " + str(e) - print(error_string) - return error_string - finally: if cursor_system_db: cursor_system_db.close() if cnx_system_db: cnx_system_db.close() + print(error_string) + return error_string #################################################################################################################### # Step 4: get all equipments associated with the combined equipment