fw-addr-lists: rework the retry logic

... with increasing delay.
This commit is contained in:
Christian Hesse 2023-10-19 21:15:23 +02:00
parent 1f6040178f
commit d4e5194a65

View file

@ -50,13 +50,16 @@ $WaitFullyConnected;
} }
} }
:for I from=2 to=0 do={ :for I from=1 to=4 do={
:if ($Data = false) do={ :if ($Data = false) do={
: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={ } on-error={
$LogPrintExit2 debug $0 ("Failed downloading, " . $I . " retries pending: " . $List->"url") false; :if ($I < 4) do={
:delay 2s; $LogPrintExit2 debug $0 ("Failed downloading, " . $I . ". try: " . $List->"url") false;
:delay (($I * $I) . "s");
}
} }
} }
} }