]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Worker.php
bugfixing ini-loading
[friendica.git] / src / Core / Worker.php
index aae3e85d0824ada4bc957b31a7b33def0613b798..00b22c78858c0b06c34ca643174b251fca5a5240 100644 (file)
@@ -31,6 +31,7 @@ class Worker
         *
         * @param boolean $run_cron Should the cron processes be executed?
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function processQueue($run_cron = true)
        {
@@ -148,6 +149,7 @@ class Worker
         * @brief Returns the number of deferred entries in the worker queue
         *
         * @return integer Number of deferred entries in the worker queue
+        * @throws \Exception
         */
        private static function deferredEntries()
        {
@@ -159,6 +161,7 @@ class Worker
         * @brief Returns the number of non executed entries in the worker queue
         *
         * @return integer Number of non executed entries in the worker queue
+        * @throws \Exception
         */
        private static function totalEntries()
        {
@@ -170,6 +173,7 @@ class Worker
         * @brief Returns the highest priority in the worker queue that isn't executed
         *
         * @return integer Number of active worker processes
+        * @throws \Exception
         */
        private static function highestPriority()
        {
@@ -188,6 +192,7 @@ class Worker
         * @param integer $priority The priority that should be checked
         *
         * @return integer Is there a process running with that priority?
+        * @throws \Exception
         */
        private static function processWithPriorityActive($priority)
        {
@@ -202,6 +207,7 @@ class Worker
         * @param array $queue Workerqueue entry
         *
         * @return boolean "true" if further processing should be stopped
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function execute($queue)
        {
@@ -315,6 +321,7 @@ class Worker
         * @param array   $argv        Array of values to be passed to the function
         * @param boolean $method_call boolean
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function execFunction($queue, $funcname, $argv, $method_call)
        {
@@ -481,6 +488,7 @@ class Worker
         * @brief Checks if the number of database connections has reached a critical limit.
         *
         * @return bool Are more than 3/4 of the maximum connections used?
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function maxConnectionsReached()
        {
@@ -558,6 +566,7 @@ class Worker
        /**
         * @brief fix the queue entry if the worker process died
         * @return void
+        * @throws \Exception
         */
        private static function killStaleWorkers()
        {
@@ -622,6 +631,7 @@ class Worker
         * @brief Checks if the number of active workers exceeds the given limits
         *
         * @return bool Are there too much workers running?
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function tooMuchWorkers()
        {
@@ -726,6 +736,7 @@ class Worker
         * @brief Returns the number of active worker processes
         *
         * @return integer Number of active worker processes
+        * @throws \Exception
         */
        private static function activeWorkers()
        {
@@ -740,6 +751,7 @@ class Worker
         *
         * @param string $highest_priority Returns the currently highest priority
         * @return bool We let pass a slower process than $highest_priority
+        * @throws \Exception
         */
        private static function passingSlow(&$highest_priority)
        {
@@ -792,6 +804,7 @@ class Worker
         *
         * @param boolean $passing_slow Returns if we had passed low priority processes
         * @return boolean Have we found something?
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function findWorkerProcesses(&$passing_slow)
        {
@@ -886,6 +899,7 @@ class Worker
         *
         * @param boolean $passing_slow Returns if we had passed low priority processes
         * @return string SQL statement
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function workerProcess(&$passing_slow)
        {
@@ -921,6 +935,7 @@ class Worker
        /**
         * @brief Removes a workerqueue entry from the current process
         * @return void
+        * @throws \Exception
         */
        public static function unclaimProcess()
        {
@@ -932,6 +947,7 @@ class Worker
        /**
         * @brief Call the front end worker
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function callWorker()
        {
@@ -946,6 +962,7 @@ class Worker
        /**
         * @brief Call the front end worker if there aren't any active
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function executeIfIdle()
        {
@@ -996,6 +1013,7 @@ class Worker
        /**
         * @brief Removes long running worker processes
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function clearProcesses()
        {
@@ -1010,6 +1028,7 @@ class Worker
        /**
         * @brief Runs the cron processes
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function runCron()
        {
@@ -1027,7 +1046,9 @@ class Worker
 
        /**
         * @brief Spawns a new worker
+        * @param bool $do_cron
         * @return void
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function spawnWorker($do_cron = false)
        {
@@ -1052,12 +1073,13 @@ class Worker
         * or: Worker::add(PRIORITY_HIGH, "Notifier", "drop", $drop_id);
         * or: Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowEntry", $post_id);
         *
+        * @return boolean "false" if proc_run couldn't be executed
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @note $cmd and string args are surrounded with ""
         *
         * @hooks 'proc_run'
-        *      array $arr
+        *    array $arr
         *
-        * @return boolean "false" if proc_run couldn't be executed
         */
        public static function add($cmd)
        {
@@ -1186,6 +1208,7 @@ class Worker
         *
         * @brief Remove the active process from the "process" table
         * @return bool
+        * @throws \Exception
         */
        public static function endProcess()
        {
@@ -1197,6 +1220,7 @@ class Worker
         *
         * @brief Set the flag if some job is waiting
         * @param boolean $jobs Is there a waiting job?
+        * @throws \Exception
         */
        public static function IPCSetJobState($jobs)
        {
@@ -1208,6 +1232,7 @@ class Worker
         *
         * @brief Checks if some worker job waits to be executed
         * @return bool
+        * @throws \Exception
         */
        public static function IPCJobsExists()
        {