diff --git a/hgweb/command-runner.sh b/hgweb/command-runner.sh index 56c5fa037..e99342567 100644 --- a/hgweb/command-runner.sh +++ b/hgweb/command-runner.sh @@ -36,7 +36,9 @@ echo "" # Run the hg command, simply output to stdout first_char=$(echo $project_code | cut -c1) # Ensure NFS cache is refreshed in case project repo changed in another pod (e.g., project reset) -ls /var/hg/repos/$first_char/$project_code > /dev/null # Don't need output; this is enough to refresh NFS dir cache +ls /var/hg/repos/$first_char/$project_code >/dev/null 2>/dev/null # Don't need output; this is enough to refresh NFS dir cache +# Sometimes invalidatedircache is called after deleting a project, so the cd would fail. So exit fast in that case. +[ "x$command_name" = "xinvalidatedircache" ] && exit 0 cd /var/hg/repos/$first_char/$project_code case $command_name in @@ -63,10 +65,6 @@ case $command_name in timeout 5 chg verify 2>&1 ;; - invalidatedircache) - # Do nothing; the ls before the case was the whole point of this command - ;; - *) # Env var PYTHONUNBUFFERED required for commands like verify and recover, so that output can stream back to the project page PYTHONUNBUFFERED=1 chg $command_name 2>&1