Skip to content

Commit

Permalink
Added CacheItem.accessed
Browse files Browse the repository at this point in the history
  • Loading branch information
npalacioescat committed Sep 19, 2024
1 parent 0df8579 commit fd1e389
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cache_manager/_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ def version_id(self) -> str:
return f'{self.key}-{self.version}'


def accessed(self):

if self.cache:
self.cache._accessed(self._id)


def update_date(
self,
datefield: str = 'date',
Expand Down Expand Up @@ -472,7 +478,7 @@ def _open(self, **kwargs) -> _open.Opener:
documentation for more details.
"""

self.cache._accessed(self._id)
self.accessed()

return _open.Opener(self.path, **kwargs)

Expand Down

0 comments on commit fd1e389

Please sign in to comment.