]> git.mxchange.org Git - friendica.git/commitdiff
New function for the number of retrials / Daily reload of hooks
authorMichael <heluecht@pirati.ca>
Tue, 15 Aug 2023 02:13:50 +0000 (02:13 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 15 Aug 2023 02:13:50 +0000 (02:13 +0000)
src/Core/Worker.php
src/Worker/Cron.php

index 00885f69200a04f59c8a601020031ebc7a5d8a0c..7075b4b236f77c90974bd3b99c423ad03a5ae04b 100644 (file)
@@ -1365,6 +1365,17 @@ class Worker
                return $new_retrial;
        }
 
+       /**
+        * Get the number of retrials for the current worker task
+        *
+        * @return integer
+        */
+       public static function getRetrial(): int
+       {
+               $queue = DI::app()->getQueue();
+               return $queue['retrial'] ?? 0;
+       }
+
        /**
         * Defers the current worker entry
         *
index 73d158070ee7469860b54970e321a87582091448..18ede945c567b4275d1dbf38077aed41492b6aae 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Worker;
 
+use Friendica\Core\Addon;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Worker;
@@ -146,6 +147,8 @@ class Cron
                        // Update "blocked" status of servers
                        Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
 
+                       Addon::reload();
+
                        DI::keyValue()->set('last_cron_daily', time());
                }