]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Photo.php
Merge pull request #12586 from MrPetovan/task/entitize-delivery-queue
[friendica.git] / src / Module / Photo.php
index 35348be70799789fb444a70d30181b8d01131ee0..3f18058de28cf3899cbe5770751379e869da4b96 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -44,6 +44,7 @@ use Friendica\Util\Images;
 use Friendica\Util\Network;
 use Friendica\Util\ParseUrl;
 use Friendica\Util\Proxy;
+use Friendica\Worker\UpdateContact;
 
 /**
  * Photo Module
@@ -351,8 +352,12 @@ class Photo extends BaseModule
                                                        Logger::debug('Got return code for avatar', ['return code' => $curlResult->getReturnCode(), 'cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
                                                }
                                                if ($update) {
-                                                       Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
-                                                       Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id);
+                                                       try {
+                                                               UpdateContact::add(Worker::PRIORITY_LOW, $id);
+                                                               Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
+                                                       } catch (\InvalidArgumentException $e) {
+                                                               Logger::notice($e->getMessage(), ['id' => $id, 'contact' => $contact]);
+                                                       }
                                                } else {
                                                        Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
                                                }