Watch
0
0
Fork
You've already forked hyperhive
0

archive: read the repository without its lock for the prune metrics

This commit is contained in:
atlas 2026-11-14 11:40:20 +01:00
commit c4919c5945

View file

@ -255,7 +255,7 @@ in
"hyperhive.archive.prune.last_run_success=$ok"
"hyperhive.archive.prune.last_run_timestamp_seconds=$(date +%s)"
)
if snaps="$(${restic}/bin/restic -r "$repo" --retry-lock 10m snapshots --json 2>/dev/null)" \
if snaps="$(${restic}/bin/restic -r "$repo" --no-lock snapshots --json 2>/dev/null)" \
&& count="$(jq 'length' <<<"$snaps" 2>/dev/null)"; then
metrics+=("hyperhive.archive.repo.snapshots=$count")
while read -r time; do
@ -267,7 +267,7 @@ in
metrics+=("hyperhive.archive.repo.latest_snapshot_timestamp_seconds=$latest")
fi
fi
if stats="$(${restic}/bin/restic -r "$repo" --retry-lock 10m stats --mode raw-data --json 2>/dev/null)" \
if stats="$(${restic}/bin/restic -r "$repo" --no-lock stats --mode raw-data --json 2>/dev/null)" \
&& stats="$(jq -r '.total_size' <<<"$stats" 2>/dev/null)"; then
metrics+=("hyperhive.archive.repo.size_bytes=$stats")
fi