From 86555460d2e62a1881741038de0a5cba19b33822 Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:41:50 +0100 Subject: [PATCH] Fixes to database manager --- cognitive_architecture/config.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cognitive_architecture/config.py b/cognitive_architecture/config.py index d5cc58184..a113fd5ad 100644 --- a/cognitive_architecture/config.py +++ b/cognitive_architecture/config.py @@ -64,20 +64,18 @@ class Config: graph_database_password: str = os.getenv("GRAPH_DB_PW") weaviate_url: str = os.getenv("WEAVIATE_URL") weaviate_api_key: str = os.getenv("WEAVIATE_API_KEY") - postgres_user: str = os.getenv("POSTGRES_USER") - postgres_password: str = os.getenv("POSTGRES_PASSWORD") - postgres_db: str = os.getenv("POSTGRES_DB") + if ( os.getenv("ENV") == "prod" or os.getenv("ENV") == "dev" or os.getenv("AWS_ENV") == "dev" or os.getenv("AWS_ENV") == "prd" ): - postgres_host: str = os.getenv("POSTGRES_PROD_HOST") - elif os.getenv("ENV") == "docker": - postgres_host: str = os.getenv("POSTGRES_HOST_DOCKER") - elif os.getenv("ENV") == "local": - postgres_host: str = os.getenv("POSTGRES_HOST_LOCAL") + db_host: str = os.getenv("POSTGRES_PROD_HOST") + db_user: str = os.getenv("POSTGRES_USER") + db_password: str = os.getenv("POSTGRES_PASSWORD") + db_name: str = os.getenv("POSTGRES_DB") + # Client ID anon_clientid: Optional[str] = field(default_factory=lambda: uuid.uuid4().hex)