Mirror of https://github.com/roostorg/osprey github.com/roostorg/osprey
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make BT Client a cached instance (#116)

authored by

Leon Shi and committed by
GitHub
de6347c3 2b997ae8

+4 -3
+4 -3
osprey_worker/src/osprey/worker/lib/storage/bigtable.py
··· 28 28 _gcp_project: str 29 29 _instance_id: str 30 30 _admin_enabled: bool 31 + _cached_instance: Instance | None = None 31 32 32 33 def _setup_client_instance(self) -> Instance: 33 34 client = Client(project=self._gcp_project, admin=self._admin_enabled) ··· 37 38 38 39 @property 39 40 def _instance(self) -> Instance: 40 - if not getattr(self, '__instance', None): 41 - self.__instance = self._setup_client_instance() 42 - return self.__instance 41 + if self._cached_instance is None: 42 + self._cached_instance = self._setup_client_instance() 43 + return self._cached_instance 43 44 44 45 @abstractmethod 45 46 def init_from_config(self, config: Config) -> None: ...