Skip to content

Commit

Permalink
Always cache metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
thcrock committed Mar 7, 2019
1 parent 55acec4 commit 8e2089f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/triage/component/catwalk/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,7 @@ def metadata(self):
"""The raw metadata. Will load from storage into memory if not already loaded"""
if self.__metadata is not None:
return self.__metadata
metadata = self.load_metadata()
if self.should_cache:
self.__metadata = metadata
else:
return metadata
self.__metadata = self.load_metadata()
return self.__metadata

@metadata.setter
Expand Down Expand Up @@ -540,7 +536,6 @@ def save(self):

def clear_cache(self):
self._matrix_label_tuple = None
self.metadata = None

def __getstate__(self):
"""Remove object of a large size upon serialization.
Expand All @@ -549,7 +544,6 @@ def __getstate__(self):
"""
state = self.__dict__.copy()
state['_matrix_label_tuple'] = None
state['__metadata'] = None
return state


Expand Down

0 comments on commit 8e2089f

Please sign in to comment.