fixed Cursor is not connected issues in combined equipment procedures in aggregation

pull/18/head
13621160019@163.com 2021-03-14 17:50:45 +08:00
parent d242e7226a
commit 0122ece16f
3 changed files with 6 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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