diff --git a/src/flask_covid19/blueprints/data_vaccination/vaccination_service_update.py b/src/flask_covid19/blueprints/data_vaccination/vaccination_service_update.py index fcdd0e2c6187ed46b645277b407b1d49bfbb6d32..e9de9e8bf38669a74765ec5a2b6c3c5b8068b238 100644 --- a/src/flask_covid19/blueprints/data_vaccination/vaccination_service_update.py +++ b/src/flask_covid19/blueprints/data_vaccination/vaccination_service_update.py @@ -1,4 +1,4 @@ -from database import db, app +from database import db, app, cache from flask_covid19.blueprints.app_all.all_config import BlueprintConfig from flask_covid19.blueprints.app_web.web_model_factory import BlueprintDateReportedFactory from flask_covid19.blueprints.data_vaccination.vaccination_model_import import VaccinationImport @@ -23,6 +23,8 @@ class VaccinationServiceUpdateFull(VaccinationServiceUpdateBase): app.logger.info(" VaccinationServiceUpdateFull.__full_update_date_reported [begin]") app.logger.info("------------------------------------------------------------") VaccinationDateReported.remove_all() + with app.app_context(): + cache.clear() date_reported_list = VaccinationImport.get_date_reported_as_array() i = 0 for one_date_reported in date_reported_list: diff --git a/src/flask_covid19/blueprints/data_who/who_model.py b/src/flask_covid19/blueprints/data_who/who_model.py index 02f82ec1aee3c9731242ffe42666882a539bcbb7..796482e17f1c05fb72f3aaf9780189cad8814934 100644 --- a/src/flask_covid19/blueprints/data_who/who_model.py +++ b/src/flask_covid19/blueprints/data_who/who_model.py @@ -67,8 +67,7 @@ class WhoCountry(BlueprintLocation): ) def __repr__(self): - return "%s(%s %s %s)" % (self.__class__.__name__, - self.location_group.__repr__(), self.location_code, self.location) + return "%s(%s %s)" % (self.__class__.__name__, self.location_code, self.location) def __str__(self): return self.location_group.__str__() + " : " + self.location_code + " | " + self.location diff --git a/src/flask_covid19/blueprints/data_who/who_service_update.py b/src/flask_covid19/blueprints/data_who/who_service_update.py index 50e39556bb9440168948c0080a61b2555093d566..4b1388bd6fce6f66b5a63dc2a61e23c86c45f835 100644 --- a/src/flask_covid19/blueprints/data_who/who_service_update.py +++ b/src/flask_covid19/blueprints/data_who/who_service_update.py @@ -1,4 +1,4 @@ -from database import db, app +from database import db, app, cache from flask_covid19.blueprints.app_all.all_config import BlueprintConfig from flask_covid19.blueprints.app_web.web_model_factory import BlueprintDateReportedFactory from flask_covid19.blueprints.data_who.who_model import WhoCountryRegion, WhoDateReported, WhoCountry, WhoData @@ -22,6 +22,8 @@ class WhoServiceUpdateFull(WhoServiceUpdateBase): app.logger.info(" WhoServiceUpdateFull.__full_update_date_reported [begin]") app.logger.info("------------------------------------------------------------") WhoDateReported.remove_all() + with app.app_context(): + cache.clear() log_lines = [] i = 0 # myresultarray = [] @@ -81,6 +83,8 @@ class WhoServiceUpdateFull(WhoServiceUpdateBase): app.logger.info("------------------------------------------------------------") WhoCountry.remove_all() self.__full_update_region() + with app.app_context(): + cache.clear() result = WhoImport.countries() log_lines = [] i = 0 @@ -114,6 +118,8 @@ class WhoServiceUpdateFull(WhoServiceUpdateBase): app.logger.info("------------------------------------------------------------") app.logger.info(" WhoData.remove_all() [begin]") WhoData.remove_all() + with app.app_context(): + cache.clear() app.logger.info(" WhoData.remove_all() [done]") new_dates_reported_as_string_array = WhoImport.get_dates_reported_as_string_array() new_dates_reported_from_import = []