global-functions: $FetchHuge: remove file on failed download

This commit is contained in:
Christian Hesse 2024-04-03 17:36:47 +02:00
parent 61ee5cbd6c
commit 402f847db2

View file

@ -417,6 +417,9 @@
/tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value;
} on-error={
:if ([ $WaitForFile $FileName 500ms ] = true) do={
/file/remove $FileName;
}
$LogPrint debug $0 ("Failed downloading from: " . $Url);
:return false;
}