diff options
Diffstat (limited to 'init.php')
-rw-r--r-- | init.php | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -120,8 +120,16 @@ class Api_Resize_Media extends Plugin { } $local_filename = sha1($url); + $local_filename_flag = "$local_filename.api_resize-flag"; $quality = $this->host->get($this, "quality", self::DEFAULT_QUALITY); + 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; + } + + $this->cache->touch($local_filename_flag); + if (!$this->cache->exists($local_filename)) { $data = fetch_file_contents(["url" => $url, "max_size" => Config::get(Config::MAX_CACHE_FILE_SIZE)]); |