diff --git a/documentation/Architecture.pptx b/documentation/Architecture.pptx index e9387a9..c700102 100644 Binary files a/documentation/Architecture.pptx and b/documentation/Architecture.pptx differ diff --git a/production/api/app/http_service.py b/production/api/app/http_service.py index 4096cb1..1e715fb 100644 --- a/production/api/app/http_service.py +++ b/production/api/app/http_service.py @@ -16,6 +16,7 @@ def post(self, url, data, headers={}): def http_service_factory_get(): http_service = None def get(): + nonlocal http_service if http_service is None: http_service = HttpService() return http_service diff --git a/production/api/app/redis_client.py b/production/api/app/redis_client.py index faf94b9..a9b46bf 100644 --- a/production/api/app/redis_client.py +++ b/production/api/app/redis_client.py @@ -20,6 +20,7 @@ def redis_factory_get(host:str, port:int): redis_instance = None def get(): + nonlocal redis_instance if redis_instance is None: redis_instance = RedisClient(host, port) return redis_instance diff --git a/production/ia-worker/app/app_settings.py b/production/ia-worker/app/app_settings.py index 0139368..0875d40 100644 --- a/production/ia-worker/app/app_settings.py +++ b/production/ia-worker/app/app_settings.py @@ -62,6 +62,7 @@ def init_settings_environments(settings: dict) -> dict: def app_settings_factory_get(): app_settings_instance = None def get(): + nonlocal app_settings_instance if app_settings_instance is not None: return app_settings_instance diff --git a/production/ia-worker/app/http_service.py b/production/ia-worker/app/http_service.py index 4096cb1..1e715fb 100644 --- a/production/ia-worker/app/http_service.py +++ b/production/ia-worker/app/http_service.py @@ -16,6 +16,7 @@ def post(self, url, data, headers={}): def http_service_factory_get(): http_service = None def get(): + nonlocal http_service if http_service is None: http_service = HttpService() return http_service diff --git a/production/ia-worker/app/redis_client.py b/production/ia-worker/app/redis_client.py index faf94b9..a9b46bf 100644 --- a/production/ia-worker/app/redis_client.py +++ b/production/ia-worker/app/redis_client.py @@ -20,6 +20,7 @@ def redis_factory_get(host:str, port:int): redis_instance = None def get(): + nonlocal redis_instance if redis_instance is None: redis_instance = RedisClient(host, port) return redis_instance