From 170292660520d9c84754a036f91ad4e3664ae040 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Sun, 4 Sep 2022 13:20:41 +0200 Subject: [PATCH] Retry on 409 error --- clients/report_loadavg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clients/report_loadavg b/clients/report_loadavg index b5036c9..1767f98 100755 --- a/clients/report_loadavg +++ b/clients/report_loadavg @@ -4,6 +4,7 @@ import hmac import json import os import pprint +import random import socket import time @@ -47,6 +48,8 @@ def report_loadavg(): pprint.pp(report) r = requests.post(baseurl + "report", json=report) print(r) - return + if r.status_code != 409: + return + time.sleep(0.5 + random.random()) report_loadavg()