From 2c6d1ee7abadfcd2098655ef246a6026db134d1b Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 24 Apr 2015 15:56:34 -0700 Subject: [PATCH] gc.sh: remove stale htmlcache .lock files There should never be any. Unless the page cache generation experienced a catastrophic failure right in the middle of generating a cached page. In which case that page will never be cached again until we get rid of the .lock file. So remove any htmlcache *.lock files over an hour old at gc time just in case. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jobd/gc.sh b/jobd/gc.sh index 8615996..a33dfd0 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -251,6 +251,11 @@ find . -maxdepth 1 -type f -mmin +720 -name "shallow_?*" -print0 | xargs -0 rm - # This can be stale sha1.temp, or stale *.pack.temp so we kill all stale *.temp. find objects -type f -mmin +720 -name "*.temp" -print0 | xargs -0 rm -f +# Remove any stale *.lock files in the htmlcache area that might have been left +# behind after an abnormal exit during an attempt to update a cached file and +# are more than 1 hour old. +! [ -d htmlcache ] || find htmlcache -type f -mmin +60 -name "*.lock" -print0 | xargs -0 rm -f + # Remove any stale git-svn temp files that are more than 12 hours old. # The git-svn process creates temp files with random 10 character names # in the root of $GIT_DIR. Unfortunately they do not have a recognizable -- 2.11.4.GIT