Skip to content

Better to update symlink atime when restoring cache #33

@tomchang-tubi

Description

@tomchang-tubi

Hey corca-ai,

This tool works pretty well when CI runs with large node modules.
But we noticed a possible improvement on automatically clean — in some cases the cache folder atime doesn’t get updated. so the cache will be deleted in 7 days, even we have testing access the modules.
So one quick fix could be to simply touch the symlink when restoring the cache, so the atime gets refreshed.

bellow is how I test it:

create 1 folder and 1 softlink

lrwxr-xr-x   1 lchang  staff    8 Aug 13 22:29 sl_testlink -> testlink
drwxr-xr-x   3 lchang  staff   96 Aug 13 22:39 testlink

and here is the atime:

.//testlink | atime: 2025-08-13 22:39:39 | mtime: 2025-08-13 22:39:39 | ctime: 2025-08-13 22:39:39

read or modify the files inside this folder doesn't update the atime:

$ echo 123 > testlink/test.txt

.//testlink | atime: 2025-08-13 22:39:39 | mtime: 2025-08-13 22:39:39 | ctime: 2025-08-13 22:39:39

if touch the path the atime will be updated immediately

$ touch sl_testlink

.//testlink | atime: 2025-08-13 22:44:59 | mtime: 2025-08-13 22:44:59 | ctime: 2025-08-13 22:44:59

So how about add a simply touch on the symlink when restoring the cache?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions