diff --git a/emmet-api/defect_resources.py b/emmet-api/defect_resources.py index 92feb4714a..7f84ddbbde 100644 --- a/emmet-api/defect_resources.py +++ b/emmet-api/defect_resources.py @@ -8,7 +8,7 @@ default_settings = MAPISettings() # type: ignore -db_uri = os.environ.get("MPCONTRIBS_MONGO_HOST", None) +db_uri = os.environ.get("MPMATERIALS_MONGO_HOST", None) db_version = default_settings.DB_VERSION db_suffix = os.environ["MAPI_DB_NAME_SUFFIX"] diff --git a/emmet-api/material_resources.py b/emmet-api/material_resources.py index 073dfa499e..b8db413fab 100644 --- a/emmet-api/material_resources.py +++ b/emmet-api/material_resources.py @@ -8,7 +8,8 @@ default_settings = MAPISettings() # type: ignore -db_uri = os.environ.get("MPCONTRIBS_MONGO_HOST", None) +db_uri = os.environ.get("MPMATERIALS_MONGO_HOST", None) +db_uri_tasks = os.environ.get("MPTASKS_MONGO_HOST", db_uri) db_version = default_settings.DB_VERSION db_suffix = os.environ["MAPI_DB_NAME_SUFFIX"] @@ -18,6 +19,9 @@ if len(db_uri.split("://", 1)) < 2: db_uri = "mongodb+srv://" + db_uri + if len(db_uri_tasks.split("://", 1)) < 2: + db_uri_tasks = "mongodb+srv://" + db_uri_tasks + materials_store = MongoURIStore( uri=db_uri, database=f"mp_core_{db_suffix}", @@ -54,7 +58,7 @@ ) task_store = MongoURIStore( - uri=db_uri, database="mp_core", key="task_id", collection_name="tasks" + uri=db_uri_tasks, database="mp_core", key="task_id", collection_name="tasks" ) thermo_store = MongoURIStore(