Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rteqs committed Nov 22, 2024
1 parent 4e1b65c commit 780b9e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/latch/ldata/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ def content_type(self, *, load_if_missing: bool = True) -> Optional[str]:
self.fetch_metadata()
return self._cache.content_type

def version_id(self) -> Optional[str]:
# note: must always be fetched to keep in sync with db
self.fetch_metadata()
def version_id(self, *, load_if_missing: bool = True) -> Optional[str]:
if self._cache.content_type is None and load_if_missing:
self.fetch_metadata()
return self._cache.version_id

def is_dir(self, *, load_if_missing: bool = True) -> bool:
Expand Down Expand Up @@ -323,7 +323,9 @@ def download(

not_windows = sys.platform != "win32"
dst_str = str(dst)
version_id = self.version_id

self._clear_cache()
version_id = self.version_id()
if not not_windows and cache and dst.exists() and version_id == xattr.getxattr(dst_str, 'user.version_id'):
return dst

Expand Down

0 comments on commit 780b9e5

Please sign in to comment.