mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-01-15 16:39:25 +01:00
updates method to get value dict from cache
This commit is contained in:
@@ -32,8 +32,8 @@ class DataServiceCache:
|
|||||||
def update_cache(self, full_access_path: str, value: Any) -> None:
|
def update_cache(self, full_access_path: str, value: Any) -> None:
|
||||||
set_nested_value_by_path(self._cache, full_access_path, value)
|
set_nested_value_by_path(self._cache, full_access_path, value)
|
||||||
|
|
||||||
def get_value_dict_from_cache(self, full_access_path: str) -> dict[str, Any] | None:
|
def get_value_dict_from_cache(self, full_access_path: str) -> dict[str, Any]:
|
||||||
try:
|
try:
|
||||||
return get_nested_dict_by_path(self._cache, full_access_path)
|
return get_nested_dict_by_path(self._cache, full_access_path)
|
||||||
except (SerializationPathError, SerializationValueError, KeyError):
|
except (SerializationPathError, SerializationValueError, KeyError):
|
||||||
return None
|
return {}
|
||||||
|
|||||||
Reference in New Issue
Block a user