Retry gitea repo setting HTTP POSTs

I ran our global gitea project sync playbook across all eight gitea
hosts and one failed with a 404 against a specific project. Rerunning
the playbook against that one gitea server worked fine.

Until we sort out why this might happen lets retry our HTTP POSTs up to
3 times until they succeed.

Some numbers: We have ~2k repos and 8 servers and make two http requests
per repo for a total of 32k requests. If one fails out of that the
success rate is very high so retrying a few times should be fine.

Change-Id: I937a4f852f6713a419c03a17c3b4984a97eae0d8
This commit is contained in:
Clark Boylan 2019-03-15 13:01:39 -07:00
parent 877e58a386
commit 177edc0abb
1 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,10 @@
- name: Adjust repo settings
when: gitea_always_update or project.project not in gitea_repos
register: result
retries: 3
until: result is succeeded
delay: 5
uri:
url: "{{ gitea_url }}/{{ org }}/{{ repo }}/settings"
validate_certs: false
@ -75,6 +79,10 @@
tracker_issue_style: numeric
- name: Set default branch
when: gitea_always_update or project.project not in gitea_repos
register: result
retries: 3
until: result is succeeded
delay: 5
uri:
url: "{{ gitea_url }}/{{ org }}/{{ repo }}/settings/branches"
validate_certs: false