From 1074b0a203f8192dd74b15f67e0a168cf9f3187a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Aug 2023 09:26:21 +0300 Subject: only create flagfile if not exists --- init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.php b/init.php index 2cafbd0..6a65cc5 100644 --- a/init.php +++ b/init.php @@ -147,10 +147,10 @@ class Api_Resize_Media extends Plugin { if ($this->cache->exists($local_filename_flag)) { Debug::log("[api_resize_media] $local_filename_flag exists, looks like we failed on this URL before; skipping.", Debug::LOG_VERBOSE); return; + } else { + $this->cache->put($local_filename_flag, ""); } - $this->cache->put($local_filename_flag, ""); - if (!$this->cache->exists($local_filename)) { $data = UrlHelper::fetch(["url" => $url, "max_size" => Config::get(Config::MAX_CACHE_FILE_SIZE)]); -- cgit v1.2.3