MCPcopy
hub / github.com/caronc/apprise / get

Method get

apprise/persistent_store.py:814–833  ·  view source on GitHub ↗

Fetches from cache.

(
        self,
        key: str,
        default: Any = None,
        lazy: bool = True,
    )

Source from the content-addressed store, hash-verified

812 raise exception.AppriseDiskIOError(str(e)) from None
813
814 def get(
815 self,
816 key: str,
817 default: Any = None,
818 lazy: bool = True,
819 ) -> Any:
820 """Fetches from cache."""
821
822 if self._cache is None and not self.__load_cache():
823 return default
824
825 if (
826 key in self._cache
827 and self.__mode != PersistentStoreMode.MEMORY
828 and not self.__dirty
829 ):
830 # ensure we renew our content
831 self.__renew.add(self.cache_file)
832
833 return self._cache[key].value if self._cache.get(key) else default
834
835 def set(
836 self,

Calls 2

__load_cacheMethod · 0.95
addMethod · 0.45