Skip to content

Commit

Permalink
bee-cache: let cache_verify rebuild the main INVENTORY on error
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Aug 7, 2012
1 parent 25ade96 commit b0bb8be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bee-cache.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ VERSION=${BEE_VERSION}
: ${BEECACHE_INVENTORY=${BEECACHE_CACHEDIR}/INVENTORY}

function cache_verify() {
if ! ${BEEFLOCK} --shared "${BEECACHE_INVENTORY}" \
if ${BEEFLOCK} --shared "${BEECACHE_INVENTORY}" \
sort -c -u -r -k8 -k1 "${BEECACHE_INVENTORY}" 2>/dev/null ; then
rm -fr "${BEECACHE_CACHEDIR}"
return
fi

rm -fr "${BEECACHE_CACHEDIR}"
mkdir -p "${BEECACHE_CACHEDIR}"

${BEEFLOCK} ${BEECACHE_INVENTORY} \
${BEE_LIBEXECDIR}/bee/bee-cache-update >/dev/null
}

function cache_update() {
Expand Down

0 comments on commit b0bb8be

Please sign in to comment.