]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/UpdateGServers.php
Detection of local requests
[friendica.git] / src / Worker / UpdateGServers.php
index 486dbc93c225ecfe96d9c96571c7549ba39a85c6..38ab6e5d3079f0e55cc3dc4d7cfe9671eaa7c85c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -62,12 +62,15 @@ class UpdateGServers
                        // There are duplicated "url" but not "nurl". So we check both addresses instead of just overwriting them,
                        // since that would mean loosing data.
                        if (!empty($gserver['url'])) {
-                               Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['url']);
+                               if (Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['url'])) {
+                                       $count++;
+                               }
                        }
                        if (!empty($gserver['nurl']) && ($gserver['nurl'] != Strings::normaliseLink($gserver['url']))) {
-                               Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['nurl']);
+                               if (Worker::add(PRIORITY_LOW, 'UpdateGServer', $gserver['nurl'])) {
+                                       $count++;
+                               }
                        }
-                       $count++;
                }
                DBA::close($gservers);
                Logger::info('Updated servers', ['count' => $count]);