Skip to content
Snippets Groups Projects
Verified Commit 454956ba authored by Vincent Sellier's avatar Vincent Sellier
Browse files

swh/counters: Avoid refresh_history cronjob infinite retries

- Use the retry command line
- Split the rpc checks from the refresh endpoint call
- Fix a couple of minor side issues

Related to swh/infra/sysadm-environment#5387
parent 2ead92fe
No related branches found
No related tags found
1 merge request!463swh/counters: Avoid refresh_history cronjob infinite retries
......@@ -4,6 +4,7 @@
apiVersion: batch/v1
kind: CronJob
metadata:
namespace: {{ $.Values.namespace }}
name: counters-refresh-counters-cache-cronjob
spec:
# By default, every 4h
......@@ -92,7 +93,7 @@ spec:
items:
- key: "refresh-counters-cache.sh"
path: "refresh-counters-cache.sh"
restartPolicy: OnFailure
restartPolicy: Never
{{- end -}}
{{- end -}}
......@@ -34,14 +34,13 @@ data:
}
EOF
# This waits for the rpc to be up
while true; do
sleep 1
set +e
curl -f -v -XPOST -H 'Content-Type: application/json' $host/refresh_history -d @"${tmp_file}"
[[ $? -ne 0 ]] || break
set -e
done
echo Wait 60s for the ${host} rpc service
retry -t 6 -d 10 -- curl -f -s ${host}
echo "${host} is up"
echo "Refreshing the counters history"
curl -f -v -XPOST -H 'Content-Type: application/json' $host/refresh_history -d @"${tmp_file}"
echo "Done"
fetch-static-history.sh: |
#!/bin/bash
......
......@@ -5,7 +5,7 @@ software_stories_image_version: '20230912.1'
swh_alter_image: container-registry.softwareheritage.org/swh/infra/swh-apps/alter
swh_alter_image_version: '20240820.1'
swh_counters_image: container-registry.softwareheritage.org/swh/infra/swh-apps/counters
swh_counters_image_version: '20240814.1'
swh_counters_image_version: '20240826.1'
swh_deposit_checkers_image: container-registry.softwareheritage.org/swh/infra/swh-apps/deposit_checkers
swh_deposit_checkers_image_version: '20240813.1'
swh_deposit_image: container-registry.softwareheritage.org/swh/infra/swh-apps/deposit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment