Skip to content

Commit

Permalink
Avoid unnecessary callout to the secret backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Jun 5, 2024
1 parent fc38350 commit f43b395
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ops/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,9 +1436,8 @@ def set_content(self, content: Dict[str, str]):
if self._id is None:
self._id = self.get_info().id
self._backend.secret_set(typing.cast(str, self.id), content=content)
# TODO: won't this just get the same content anyway? Unless we refresh
# (which ignores the cache) then the tracked revision won't be different.
self._content = None # invalidate cache so it's refetched next get_content()
# We do not need to invalidate the cache here, as the content is the
# same until `refresh` is used, at which point the cache is invalidated.

def set_info(
self,
Expand Down

0 comments on commit f43b395

Please sign in to comment.