Skip to content

Commit

Permalink
[core] fix wheel timestamp check (#4488)
Browse files Browse the repository at this point in the history
Previously, we were only taking the max timestamp of all the subdirectories of
the given directory. So the timestamp could be incorrect if only a file changed,
and no directory changed. This fixes the issue by looking at all directories and
files given by os.walk().
  • Loading branch information
cg505 authored Jan 4, 2025
1 parent 061d4bd commit 4ab8e16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sky/backends/wheel_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ def _get_latest_modification_time(path: pathlib.Path) -> float:
if not path.exists():
return -1.
try:
return max(os.path.getmtime(root) for root, _, _ in os.walk(path))
return max(
os.path.getmtime(os.path.join(root, f))
for root, dirs, files in os.walk(path)
for f in (*dirs, *files))
except ValueError:
return -1.

Expand Down

0 comments on commit 4ab8e16

Please sign in to comment.