2929_cache_key=" ${_cache_cluster} -${_cache_device} -${_cache_interface} -${_cache_runner} "
3030_cache_base=" ${_cache_root} /${_cache_key} /build"
3131
32- # Check if an NFS cache directory is healthy (readable, writable, no stale handles).
33- _nfs_cache_healthy () {
32+ # Check if the cache directory is healthy (readable, writable, no stale handles).
33+ _cache_healthy () {
3434 local dir=" $1 "
3535 if ! ls " $dir " > /dev/null 2>&1 ; then
3636 echo " Health check FAILED: cannot list $dir "
@@ -51,8 +51,8 @@ _nfs_cache_healthy() {
5151
5252# Nuclear recovery: rename stale cache out of the way and create a fresh one.
5353# Uses mv (operates on parent directory entry) which works even when children
54- # have stale NFS file handles that prevent rm -rf from succeeding.
55- _nfs_cache_nuke () {
54+ # have stale file handles that prevent rm -rf from succeeding.
55+ _cache_nuke () {
5656 local base=" ${1:- $_cache_base } "
5757 local stale_name=" ${base} .stale.$( date +%s) "
5858 echo " NFS cache nuke: parking stale dir -> $stale_name "
@@ -74,9 +74,9 @@ echo " Cache key: $_cache_key"
7474echo " Cache dir: $_cache_dir "
7575
7676# Pre-flight: detect stale NFS handles before wasting a build attempt.
77- if ! _nfs_cache_healthy " $_cache_dir " ; then
77+ if ! _cache_healthy " $_cache_dir " ; then
7878 echo " Stale NFS cache detected — nuking and recreating."
79- _nfs_cache_nuke " $_cache_base "
79+ _cache_nuke " $_cache_base "
8080 _cache_dir=" $( cd " $_cache_base " && pwd -P) "
8181fi
8282
@@ -94,7 +94,7 @@ ln -s "$_cache_dir" "build"
9494
9595echo " Symlink: build -> $_cache_dir "
9696
97- # Garbage-collect stale cache dirs parked by _nfs_cache_nuke more than 7 days ago.
97+ # Garbage-collect stale cache dirs parked by _cache_nuke more than 7 days ago.
9898_cache_parent=" $( dirname " $_cache_base " ) "
9999find " $_cache_parent " -maxdepth 1 -name " *.stale.*" -mtime +7 -exec rm -rf {} + 2> /dev/null || true
100100
0 commit comments