Skip to content

Conversation

@tomchang-tubi
Copy link

@tomchang-tubi tomchang-tubi commented Aug 21, 2025

Description:

When restoring cache, the target file’s access time (atime) was not being updated in some cases.
This could cause certain cleanup or cache retention strategies that rely on atime to behave incorrectly.
Has report this to #33

Change details:

  • After creating the symlink during cache restore, added a touch -a command on the symlink target file instead of the symlink itself.
  • Ensures the actual cached files have their atime refreshed when restored.

Why this matters:

By updating the target file’s atime on restore, we ensure that cache retention policies relying on file access time work as expected and avoid unintentional cache purging.

How I test the touch works:

Test on macOS, has monitor for 3 week, the folder atime are updated everytime load the cache. And now the automatically clean up are working fine and only cleaned the cache > 7 days not restored.

fix: add touch cache folder in restore to refresh the atime
…dist (#2)

* fix: touch cache folder to refresh atime

* fix: use seprated touch cmd

* fix: touch cachePath instead

* update: src files after test done
@tomchang-tubi tomchang-tubi changed the title fix: add touch cache folder in restore to refresh the atime & update dist fix: add touch cache folder in restore to refresh the cache folder atime Aug 21, 2025
@tomchang-tubi
Copy link
Author

tomchang-tubi commented Sep 10, 2025

monitoring for 2 week, and the fix looks solid, reopen this pr for review

@tomchang-tubi tomchang-tubi reopened this Sep 10, 2025
@tomchang-tubi tomchang-tubi marked this pull request as ready for review September 10, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant