]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Cron.php
Merge remote-tracking branch 'upstream/2022.09-rc' into cooldown
[friendica.git] / src / Worker / Cron.php
index 210abfcecf6b747a08a24d1eafbc3ddfda6ed05a..12ea6e60a36c8fffd9217301f74b0124b5d9f2db 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -27,6 +27,8 @@ use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Tag;
+use Friendica\Protocol\ActivityPub\Queue;
+use Friendica\Protocol\Relay;
 
 class Cron
 {
@@ -87,14 +89,17 @@ class Cron
                        Tag::setLocalTrendingHashtags(24, 20);
                        Tag::setGlobalTrendingHashtags(24, 20);
 
+                       // Remove old pending posts from the queue
+                       Queue::clear();
+
+                       // Process all unprocessed entries
+                       Queue::processAll();
+
                        // Search for new contacts in the directory
                        if (DI::config()->get('system', 'synchronize_directory')) {
                                Worker::add(PRIORITY_LOW, 'PullDirectory');
                        }
 
-                       // Delete all done workerqueue entries                  
-                       Worker::add(PRIORITY_LOW, 'CleanWorkerQueue');
-
                        // Clear cache entries
                        Worker::add(PRIORITY_LOW, 'ClearCache');
 
@@ -110,7 +115,9 @@ class Cron
 
                        Worker::add(PRIORITY_LOW, 'ExpirePosts');
 
-                       Worker::add(PRIORITY_LOW, 'ExpireConversations');
+                       Worker::add(PRIORITY_LOW, 'ExpireActivities');
+
+                       Worker::add(PRIORITY_LOW, 'RemoveUnusedTags');
 
                        Worker::add(PRIORITY_LOW, 'RemoveUnusedContacts');
 
@@ -124,7 +131,10 @@ class Cron
                        if (DI::config()->get('system', 'optimize_tables')) {
                                Worker::add(PRIORITY_LOW, 'OptimizeTables');
                        }
-       
+
+                       // Resubscribe to relay servers
+                       Relay::reSubscribe();
+
                        DI::config()->set('system', 'last_cron_daily', time());
                }