hound: clear git lockfiles before starting daemon

If the hound service is shutdown uncleanly (like the server stops on
us) it can leave behind lock files that stop processing.  Clear old
lock files on start before indexing begins.

Also fix the job matching

Change-Id: I6e6c57d7121702eb61124c3d4c4cdc7afd3e75c3
This commit is contained in:
Ian Wienand 2021-07-30 10:34:20 +10:00
parent 3ce9e4b5ed
commit 7b80f69da0
2 changed files with 4 additions and 1 deletions

View File

@ -5,5 +5,8 @@ else
if [ ! -f /var/run/config.json ]; then
update-hound-config;
fi
# Unclean shutdown can leave lockfiles that stop processing,
# cleanup.
find . -type f \( -wholename "*/.git/index.lock" -o -wholename "*/.git/shallow.lock" \) -delete -print
/usr/local/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
fi

View File

@ -488,7 +488,7 @@
- playbooks/roles/codesearch/
- playbooks/roles/install-docker/
- playbooks/roles/pip3/
- docker/codesearch/
- docker/hound/
- testinfra/test_codesearch.py
- job: