1515# The same connection context manager is utilized here as well!
1616from simcore_sdk .node_ports_common .dbmanager import DBContextManager
1717
18+ from ..._meta import PROJECT_NAME
1819from ._packaging import dir_from_bytes , dir_to_bytes
1920from ._user_preference import get_model_class
2021
@@ -40,9 +41,10 @@ async def save_preferences(
4041 service_key = service_key , service_version = service_version , value = dir_content
4142 )
4243
43- async with DBContextManager (
44- application_name = "simcore_dynamic_sidecar"
45- ) as engine , engine .begin () as conn :
44+ async with (
45+ DBContextManager (application_name = PROJECT_NAME ) as engine ,
46+ engine .begin () as conn ,
47+ ):
4648 await UserServicesUserPreferencesRepo .save (
4749 conn ,
4850 user_id = user_id ,
@@ -63,9 +65,10 @@ async def load_preferences(
6365) -> None :
6466 preference_class = get_model_class (service_key )
6567
66- async with DBContextManager (
67- application_name = "simcore_dynamic_sidecar"
68- ) as engine , engine .connect () as conn :
68+ async with (
69+ DBContextManager (application_name = PROJECT_NAME ) as engine ,
70+ engine .connect () as conn ,
71+ ):
6972 payload = await UserServicesUserPreferencesRepo .load (
7073 conn ,
7174 user_id = user_id ,
0 commit comments