From 319b5738d9c29ea4821a08f43018ec8421116536 Mon Sep 17 00:00:00 2001 From: "13621160019@163.com" <13621160019@163.com> Date: Fri, 12 Mar 2021 14:44:15 +0800 Subject: [PATCH] added historical database close and disconnect at the end of reports --- myems-api/reports/combinedequipmentcost.py | 5 +++++ myems-api/reports/combinedequipmentefficiency.py | 5 +++++ myems-api/reports/combinedequipmentenergycategory.py | 5 +++++ myems-api/reports/combinedequipmentenergyitem.py | 5 +++++ myems-api/reports/combinedequipmentincome.py | 5 +++++ myems-api/reports/combinedequipmentload.py | 5 +++++ myems-api/reports/combinedequipmentoutput.py | 5 +++++ myems-api/reports/combinedequipmentsaving.py | 5 +++++ myems-api/reports/combinedequipmentstatistics.py | 5 +++++ myems-api/reports/equipmentcost.py | 5 +++++ myems-api/reports/equipmentenergycategory.py | 5 +++++ myems-api/reports/equipmentenergyitem.py | 5 +++++ myems-api/reports/equipmentincome.py | 5 +++++ myems-api/reports/equipmentload.py | 5 +++++ myems-api/reports/equipmentoutput.py | 5 +++++ myems-api/reports/equipmentsaving.py | 5 +++++ myems-api/reports/equipmentstatistics.py | 5 +++++ myems-api/reports/shopfloorcost.py | 5 +++++ myems-api/reports/shopfloorenergycategory.py | 5 +++++ myems-api/reports/shopfloorenergyitem.py | 5 +++++ myems-api/reports/shopfloorload.py | 5 +++++ myems-api/reports/shopfloorsaving.py | 5 +++++ myems-api/reports/shopfloorstatistics.py | 5 +++++ myems-api/reports/spacecost.py | 5 +++++ myems-api/reports/spaceefficiency.py | 5 +++++ myems-api/reports/spaceenergycategory.py | 5 +++++ myems-api/reports/spaceenergyitem.py | 5 +++++ myems-api/reports/spaceincome.py | 5 +++++ myems-api/reports/spaceload.py | 5 +++++ myems-api/reports/spaceoutput.py | 5 +++++ myems-api/reports/spacesaving.py | 5 +++++ myems-api/reports/spacestatistics.py | 5 +++++ myems-api/reports/storecost.py | 5 +++++ myems-api/reports/storeenergycategory.py | 5 +++++ myems-api/reports/storeenergyitem.py | 5 +++++ myems-api/reports/storeload.py | 5 +++++ myems-api/reports/storesaving.py | 5 +++++ myems-api/reports/storestatistics.py | 5 +++++ myems-api/reports/tenantcost.py | 5 +++++ myems-api/reports/tenantenergycategory.py | 5 +++++ myems-api/reports/tenantenergyitem.py | 5 +++++ myems-api/reports/tenantload.py | 5 +++++ myems-api/reports/tenantsaving.py | 5 +++++ myems-api/reports/tenantstatistics.py | 5 +++++ myems-api/reports/virtualmetercost.py | 5 +++++ myems-api/reports/virtualmeterenergy.py | 5 +++++ 46 files changed, 230 insertions(+) diff --git a/myems-api/reports/combinedequipmentcost.py b/myems-api/reports/combinedequipmentcost.py index ed366dcb..7eb3727f 100644 --- a/myems-api/reports/combinedequipmentcost.py +++ b/myems-api/reports/combinedequipmentcost.py @@ -452,6 +452,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentefficiency.py b/myems-api/reports/combinedequipmentefficiency.py index 5d4f4d8b..738ed05f 100644 --- a/myems-api/reports/combinedequipmentefficiency.py +++ b/myems-api/reports/combinedequipmentefficiency.py @@ -560,6 +560,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentenergycategory.py b/myems-api/reports/combinedequipmentenergycategory.py index 91a62864..3261d871 100644 --- a/myems-api/reports/combinedequipmentenergycategory.py +++ b/myems-api/reports/combinedequipmentenergycategory.py @@ -466,6 +466,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentenergyitem.py b/myems-api/reports/combinedequipmentenergyitem.py index 5e25004a..a7906240 100644 --- a/myems-api/reports/combinedequipmentenergyitem.py +++ b/myems-api/reports/combinedequipmentenergyitem.py @@ -456,6 +456,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentincome.py b/myems-api/reports/combinedequipmentincome.py index 4c8a0ade..e32558e4 100644 --- a/myems-api/reports/combinedequipmentincome.py +++ b/myems-api/reports/combinedequipmentincome.py @@ -432,6 +432,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentload.py b/myems-api/reports/combinedequipmentload.py index e47d9752..5b60c584 100644 --- a/myems-api/reports/combinedequipmentload.py +++ b/myems-api/reports/combinedequipmentload.py @@ -452,6 +452,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentoutput.py b/myems-api/reports/combinedequipmentoutput.py index 60e30665..a3810a36 100644 --- a/myems-api/reports/combinedequipmentoutput.py +++ b/myems-api/reports/combinedequipmentoutput.py @@ -432,6 +432,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentsaving.py b/myems-api/reports/combinedequipmentsaving.py index e66b21d1..75ae7755 100644 --- a/myems-api/reports/combinedequipmentsaving.py +++ b/myems-api/reports/combinedequipmentsaving.py @@ -586,6 +586,11 @@ class Reporting: if cnx_energy_baseline: cnx_energy_baseline.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/combinedequipmentstatistics.py b/myems-api/reports/combinedequipmentstatistics.py index c24ec5b1..14e2327b 100644 --- a/myems-api/reports/combinedequipmentstatistics.py +++ b/myems-api/reports/combinedequipmentstatistics.py @@ -458,6 +458,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['combined_equipment'] = dict() diff --git a/myems-api/reports/equipmentcost.py b/myems-api/reports/equipmentcost.py index e6c2cf53..4c45e257 100644 --- a/myems-api/reports/equipmentcost.py +++ b/myems-api/reports/equipmentcost.py @@ -441,6 +441,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentenergycategory.py b/myems-api/reports/equipmentenergycategory.py index a955b7b7..97fc48e4 100644 --- a/myems-api/reports/equipmentenergycategory.py +++ b/myems-api/reports/equipmentenergycategory.py @@ -456,6 +456,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentenergyitem.py b/myems-api/reports/equipmentenergyitem.py index 3f642350..6026aa34 100644 --- a/myems-api/reports/equipmentenergyitem.py +++ b/myems-api/reports/equipmentenergyitem.py @@ -448,6 +448,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentincome.py b/myems-api/reports/equipmentincome.py index 220e7cb5..8d3aa28e 100644 --- a/myems-api/reports/equipmentincome.py +++ b/myems-api/reports/equipmentincome.py @@ -423,6 +423,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentload.py b/myems-api/reports/equipmentload.py index 2c61cf54..5de6ae5e 100644 --- a/myems-api/reports/equipmentload.py +++ b/myems-api/reports/equipmentload.py @@ -445,6 +445,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentoutput.py b/myems-api/reports/equipmentoutput.py index 15e2f3bf..83be9d86 100644 --- a/myems-api/reports/equipmentoutput.py +++ b/myems-api/reports/equipmentoutput.py @@ -423,6 +423,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentsaving.py b/myems-api/reports/equipmentsaving.py index af3a3247..3adf8c95 100644 --- a/myems-api/reports/equipmentsaving.py +++ b/myems-api/reports/equipmentsaving.py @@ -575,6 +575,11 @@ class Reporting: if cnx_energy_baseline: cnx_energy_baseline.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/equipmentstatistics.py b/myems-api/reports/equipmentstatistics.py index 168d6ed2..02e65b5e 100644 --- a/myems-api/reports/equipmentstatistics.py +++ b/myems-api/reports/equipmentstatistics.py @@ -451,6 +451,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['equipment'] = dict() diff --git a/myems-api/reports/shopfloorcost.py b/myems-api/reports/shopfloorcost.py index 374ac1d1..3a2f668d 100644 --- a/myems-api/reports/shopfloorcost.py +++ b/myems-api/reports/shopfloorcost.py @@ -457,6 +457,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['shopfloor'] = dict() diff --git a/myems-api/reports/shopfloorenergycategory.py b/myems-api/reports/shopfloorenergycategory.py index 68c987e6..4f820cf9 100644 --- a/myems-api/reports/shopfloorenergycategory.py +++ b/myems-api/reports/shopfloorenergycategory.py @@ -471,6 +471,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['shopfloor'] = dict() diff --git a/myems-api/reports/shopfloorenergyitem.py b/myems-api/reports/shopfloorenergyitem.py index be542b1e..073f4cb9 100644 --- a/myems-api/reports/shopfloorenergyitem.py +++ b/myems-api/reports/shopfloorenergyitem.py @@ -463,6 +463,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['shopfloor'] = dict() diff --git a/myems-api/reports/shopfloorload.py b/myems-api/reports/shopfloorload.py index fa67ee6a..af7741c1 100644 --- a/myems-api/reports/shopfloorload.py +++ b/myems-api/reports/shopfloorload.py @@ -460,6 +460,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['shopfloor'] = dict() diff --git a/myems-api/reports/shopfloorsaving.py b/myems-api/reports/shopfloorsaving.py index 1438f7d6..3089139e 100644 --- a/myems-api/reports/shopfloorsaving.py +++ b/myems-api/reports/shopfloorsaving.py @@ -590,6 +590,11 @@ class Reporting: if cnx_energy_baseline: cnx_energy_baseline.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['shopfloor'] = dict() diff --git a/myems-api/reports/shopfloorstatistics.py b/myems-api/reports/shopfloorstatistics.py index a9347114..f470d72c 100644 --- a/myems-api/reports/shopfloorstatistics.py +++ b/myems-api/reports/shopfloorstatistics.py @@ -466,6 +466,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['shopfloor'] = dict() diff --git a/myems-api/reports/spacecost.py b/myems-api/reports/spacecost.py index 941af121..506955f1 100644 --- a/myems-api/reports/spacecost.py +++ b/myems-api/reports/spacecost.py @@ -499,6 +499,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spaceefficiency.py b/myems-api/reports/spaceefficiency.py index b95fabf5..5f7a4164 100644 --- a/myems-api/reports/spaceefficiency.py +++ b/myems-api/reports/spaceefficiency.py @@ -554,6 +554,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spaceenergycategory.py b/myems-api/reports/spaceenergycategory.py index ce88b13f..7c8027df 100644 --- a/myems-api/reports/spaceenergycategory.py +++ b/myems-api/reports/spaceenergycategory.py @@ -519,6 +519,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spaceenergyitem.py b/myems-api/reports/spaceenergyitem.py index 1e273a61..a15173fc 100644 --- a/myems-api/reports/spaceenergyitem.py +++ b/myems-api/reports/spaceenergyitem.py @@ -506,6 +506,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spaceincome.py b/myems-api/reports/spaceincome.py index 5ad66776..6b5c0679 100644 --- a/myems-api/reports/spaceincome.py +++ b/myems-api/reports/spaceincome.py @@ -480,6 +480,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spaceload.py b/myems-api/reports/spaceload.py index 3b8c3553..7cb7fbb0 100644 --- a/myems-api/reports/spaceload.py +++ b/myems-api/reports/spaceload.py @@ -460,6 +460,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spaceoutput.py b/myems-api/reports/spaceoutput.py index a1dc983b..24052555 100644 --- a/myems-api/reports/spaceoutput.py +++ b/myems-api/reports/spaceoutput.py @@ -480,6 +480,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spacesaving.py b/myems-api/reports/spacesaving.py index fc74b2f2..55acb9f3 100644 --- a/myems-api/reports/spacesaving.py +++ b/myems-api/reports/spacesaving.py @@ -661,6 +661,11 @@ class Reporting: if cnx_energy_baseline: cnx_energy_baseline.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/spacestatistics.py b/myems-api/reports/spacestatistics.py index 1a34f03b..acaeace5 100644 --- a/myems-api/reports/spacestatistics.py +++ b/myems-api/reports/spacestatistics.py @@ -464,6 +464,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['space'] = dict() diff --git a/myems-api/reports/storecost.py b/myems-api/reports/storecost.py index fa01c452..4a26ffc7 100644 --- a/myems-api/reports/storecost.py +++ b/myems-api/reports/storecost.py @@ -455,6 +455,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['store'] = dict() diff --git a/myems-api/reports/storeenergycategory.py b/myems-api/reports/storeenergycategory.py index 5b909327..3c732124 100644 --- a/myems-api/reports/storeenergycategory.py +++ b/myems-api/reports/storeenergycategory.py @@ -469,6 +469,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['store'] = dict() diff --git a/myems-api/reports/storeenergyitem.py b/myems-api/reports/storeenergyitem.py index 63697e38..b09c5e8f 100644 --- a/myems-api/reports/storeenergyitem.py +++ b/myems-api/reports/storeenergyitem.py @@ -461,6 +461,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['store'] = dict() diff --git a/myems-api/reports/storeload.py b/myems-api/reports/storeload.py index be2d95bd..d7f41b43 100644 --- a/myems-api/reports/storeload.py +++ b/myems-api/reports/storeload.py @@ -460,6 +460,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['store'] = dict() diff --git a/myems-api/reports/storesaving.py b/myems-api/reports/storesaving.py index edac5b5d..9a7f99d0 100644 --- a/myems-api/reports/storesaving.py +++ b/myems-api/reports/storesaving.py @@ -586,6 +586,11 @@ class Reporting: if cnx_energy_baseline: cnx_energy_baseline.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['store'] = dict() diff --git a/myems-api/reports/storestatistics.py b/myems-api/reports/storestatistics.py index 34ef4fb5..d1e61ae7 100644 --- a/myems-api/reports/storestatistics.py +++ b/myems-api/reports/storestatistics.py @@ -465,6 +465,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['store'] = dict() diff --git a/myems-api/reports/tenantcost.py b/myems-api/reports/tenantcost.py index c9366671..a02c7991 100644 --- a/myems-api/reports/tenantcost.py +++ b/myems-api/reports/tenantcost.py @@ -455,6 +455,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['tenant'] = dict() diff --git a/myems-api/reports/tenantenergycategory.py b/myems-api/reports/tenantenergycategory.py index 4a34a59c..56b9ef36 100644 --- a/myems-api/reports/tenantenergycategory.py +++ b/myems-api/reports/tenantenergycategory.py @@ -469,6 +469,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['tenant'] = dict() diff --git a/myems-api/reports/tenantenergyitem.py b/myems-api/reports/tenantenergyitem.py index 740cc972..8ca3d4c0 100644 --- a/myems-api/reports/tenantenergyitem.py +++ b/myems-api/reports/tenantenergyitem.py @@ -461,6 +461,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['tenant'] = dict() diff --git a/myems-api/reports/tenantload.py b/myems-api/reports/tenantload.py index 637d4bf9..e3726abc 100644 --- a/myems-api/reports/tenantload.py +++ b/myems-api/reports/tenantload.py @@ -460,6 +460,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['tenant'] = dict() diff --git a/myems-api/reports/tenantsaving.py b/myems-api/reports/tenantsaving.py index f376579f..46217ac5 100644 --- a/myems-api/reports/tenantsaving.py +++ b/myems-api/reports/tenantsaving.py @@ -586,6 +586,11 @@ class Reporting: if cnx_energy_baseline: cnx_energy_baseline.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['tenant'] = dict() diff --git a/myems-api/reports/tenantstatistics.py b/myems-api/reports/tenantstatistics.py index ffcbd2f0..ac70b966 100644 --- a/myems-api/reports/tenantstatistics.py +++ b/myems-api/reports/tenantstatistics.py @@ -464,6 +464,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = dict() result['tenant'] = dict() diff --git a/myems-api/reports/virtualmetercost.py b/myems-api/reports/virtualmetercost.py index eb1f1e0f..602d0a1e 100644 --- a/myems-api/reports/virtualmetercost.py +++ b/myems-api/reports/virtualmetercost.py @@ -341,6 +341,11 @@ class Reporting: if cnx_billing: cnx_billing.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = { "virtual_meter": { "cost_center_id": virtual_meter['cost_center_id'], diff --git a/myems-api/reports/virtualmeterenergy.py b/myems-api/reports/virtualmeterenergy.py index 4adc2516..8fe54734 100644 --- a/myems-api/reports/virtualmeterenergy.py +++ b/myems-api/reports/virtualmeterenergy.py @@ -281,6 +281,11 @@ class Reporting: if cnx_energy: cnx_energy.disconnect() + if cnx_historical: + cnx_historical.close() + if cursor_historical: + cursor_historical.disconnect() + result = { "virtual_meter": { "cost_center_id": virtual_meter['cost_center_id'],