Skip to content

Commit 4ab8e16

Browse files
authored
[core] fix wheel timestamp check (#4488)
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().
1 parent 061d4bd commit 4ab8e16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sky/backends/wheel_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ def _get_latest_modification_time(path: pathlib.Path) -> float:
153153
if not path.exists():
154154
return -1.
155155
try:
156-
return max(os.path.getmtime(root) for root, _, _ in os.walk(path))
156+
return max(
157+
os.path.getmtime(os.path.join(root, f))
158+
for root, dirs, files in os.walk(path)
159+
for f in (*dirs, *files))
157160
except ValueError:
158161
return -1.
159162

0 commit comments

Comments
 (0)