archive: read the repository without its lock for the prune metrics
This commit is contained in:
parent
b60779093e
commit
c4919c5945
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue