]> git.mxchange.org Git - friendica.git/commitdiff
Only check the homepage for active users with a homepage
authorMichael <heluecht@pirati.ca>
Fri, 23 Dec 2022 06:22:12 +0000 (06:22 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 23 Dec 2022 06:22:12 +0000 (06:22 +0000)
src/Worker/Cron.php

index d450f4cd5b19a478e5f41cfc673ffc7d17e61368..ecf8ad9f400704dca3770f9075d6c069f2133b91 100644 (file)
@@ -27,9 +27,9 @@ use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Tag;
-use Friendica\Model\User;
 use Friendica\Protocol\ActivityPub\Queue;
 use Friendica\Protocol\Relay;
+use Friendica\Util\DateTimeFormat;
 
 class Cron
 {
@@ -136,10 +136,12 @@ class Cron
                                Worker::add(Worker::PRIORITY_LOW, 'OptimizeTables');
                        }
 
-                       foreach (User::getList(1, PHP_INT_MAX, 'active') as $user) {
+                       $users = DBA::select('owner-view', ['uid'], ["`last-activity` > ? AND (`homepage_verified` OR `homepage` != ?)", DateTimeFormat::utc('now - 30 days', 'Y-m-d'), '']);
+                       while ($user = DBA::fetch($users)) {
                                Worker::add(Worker::PRIORITY_LOW, 'CheckRelMeProfileLink', $user['uid']);
                        }
-
+                       DBA::close($users);
+       
                        // Resubscribe to relay servers
                        Relay::reSubscribe();