From d4e5194a65b5a40ce458382d28b8af45086b80f7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Oct 2023 21:15:23 +0200 Subject: fw-addr-lists: rework the retry logic ... with increasing delay. --- fw-addr-lists.rsc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc index 38fdd96..26e9f98 100644 --- a/fw-addr-lists.rsc +++ b/fw-addr-lists.rsc @@ -50,13 +50,16 @@ $WaitFullyConnected; } } - :for I from=2 to=0 do={ + :for I from=1 to=4 do={ :if ($Data = false) do={ :do { - :set Data ([ /tool/fetch ($List->"url") check-certificate=$CheckCertificate output=user as-value ]->"data"); + :set Data ([ /tool/fetch check-certificate=$CheckCertificate output=user \ + ($List->"url") as-value ]->"data"); } on-error={ - $LogPrintExit2 debug $0 ("Failed downloading, " . $I . " retries pending: " . $List->"url") false; - :delay 2s; + :if ($I < 4) do={ + $LogPrintExit2 debug $0 ("Failed downloading, " . $I . ". try: " . $List->"url") false; + :delay (($I * $I) . "s"); + } } } } -- cgit v1.2.3-70-g09d2