fix: update asset mtime on failed fetch

dev
gravel 2 years ago
parent 931c0ee012
commit e0fd866e9e
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -56,6 +56,7 @@
$icon = $icon_response ? curl_multi_getcontent($icon_response) : null; $icon = $icon_response ? curl_multi_getcontent($icon_response) : null;
if (empty($icon)) { if (empty($icon)) {
log_info("$room_id returned an empty icon."); log_info("$room_id returned an empty icon.");
touch($icon_cached);
} }
// Never overwrite with an empty file. // Never overwrite with an empty file.
if (!(file_exists($icon_cached) && filesize($icon_cached) > 0 && empty($icon))) { if (!(file_exists($icon_cached) && filesize($icon_cached) > 0 && empty($icon))) {

@ -41,6 +41,7 @@
$png = $png_response ? curl_multi_getcontent($png_response) : null; $png = $png_response ? curl_multi_getcontent($png_response) : null;
if (empty($png)) { if (empty($png)) {
log_warning("$room_id returned an empty QR code."); log_warning("$room_id returned an empty QR code.");
touch($png_cached);
} }
// Never overwrite with an empty file. // Never overwrite with an empty file.
if (!(file_exists($png_cached) && filesize($png_cached) > 0 && empty($png))) { if (!(file_exists($png_cached) && filesize($png_cached) > 0 && empty($png))) {

Loading…
Cancel
Save