aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-06-23 09:35:00 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-06-23 09:49:34 +0200
commiteb3b4d169ef57a60c95cb91105bbd9401cc6ae37 (patch)
treeb52daa4365d9d7f4e26d5742c033257d76b7cfdf
parent351c7d31ffd3ca88a3407e1b9744f8d2189e39e7 (diff)
fw-addr-lists: retry to download on failure
-rw-r--r--fw-addr-lists.rsc18
1 files changed, 14 insertions, 4 deletions
diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc
index b33638e..b09cf29 100644
--- a/fw-addr-lists.rsc
+++ b/fw-addr-lists.rsc
@@ -40,8 +40,8 @@ $WaitFullyConnected;
:local Failure false;
:foreach List in=$FwList do={
- :local Data;
:local CheckCertificate "no";
+ :local Data false;
:if ([ :len ($List->"cert") ] > 0) do={
:set CheckCertificate "yes-without-crl";
@@ -50,9 +50,19 @@ $WaitFullyConnected;
}
}
- :do {
- :set Data ([ /tool/fetch ($List->"url") check-certificate=$CheckCertificate output=user as-value ]->"data");
- } on-error={
+ :for I from=2 to=0 do={
+ :if ($Data = false) do={
+ :do {
+ :set Data ([ /tool/fetch ($List->"url") check-certificate=$CheckCertificate output=user as-value ]->"data");
+ } on-error={
+ $LogPrintExit2 debug $0 ("Failed downloading, " . $I . " retries pending: " . $List->"url") false;
+ :delay 2s;
+ }
+ }
+ }
+
+ :if ($Data = false) do={
+ :set Data "";
:set Failure true;
$LogPrintExit2 warning $0 ("Failed downloading list from: " . $List->"url") false;
}