Skip to content

Commit cf39fc7

Browse files
committed
Run os.path.getctime on full path instead of just filename
Signed-off-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
1 parent f082164 commit cf39fc7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fms_fsdp/utils/checkpointing_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_oldest(targdir, qualifier=lambda x: True):
3838
if os.path.exists(targdir) and len(os.listdir(targdir)) > 0:
3939
oldest = min(
4040
[x for x in os.listdir(targdir) if qualifier(os.path.join(targdir, x))],
41-
key=os.path.getctime,
41+
key=lambda path: os.path.getctime(os.path.join(targdir, path)),
4242
)
4343
return os.path.join(targdir, oldest)
4444
return None

0 commit comments

Comments
 (0)