]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Queue.php
We are now setting the corresponding worker id
[friendica.git] / src / Protocol / ActivityPub / Queue.php
index c5cfd522ae227239b84b447e97666de0f3781403..f8f5666d13b8dbb405c57125e3ea95958f3273af 100644 (file)
@@ -89,6 +89,21 @@ class Queue
                DBA::delete('inbox-entry', ['id' => $activity['entry-id']]);
        }
 
+       /**
+        * Set the worker id for the queue entry
+        *
+        * @param array $activity
+        * @param int   $wid
+        * @return void
+        */
+       public static function setWorkerId(array $activity, int $wid)
+       {
+               if (empty($activity['entry-id']) || empty($wid)) {
+                       return;
+               }
+               DBA::update('inbox-entry', ['wid' => $wid], ['id' => $activity['entry-id']]);
+       }
+
        /**
         * Process the activity with the given id
         *
@@ -129,7 +144,7 @@ class Queue
        }
 
        /**
-        * Process all activities
+        * Clear old activities
         *
         * @return void
         */