]> git.mxchange.org Git - friendica.git/commitdiff
Further formatting fixes
authorMichael <heluecht@pirati.ca>
Fri, 20 May 2022 04:52:18 +0000 (04:52 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 20 May 2022 04:52:18 +0000 (04:52 +0000)
bin/daemon.php
src/Core/Worker/Cron.php

index 2173be1862f47735146484b3009030f06a022988..cca45c055cc1fcc2eaf5180dd659faac759046fb 100755 (executable)
@@ -18,6 +18,9 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  *
+ */
+
+/**
  * Run the worker from a daemon.
  *
  * This script was taken from http://php.net/manual/en/function.pcntl-fork.php
index da9e16d42fc41bff30b56ec3bba34e4e282c02b6..28bff8d65eca05140355e59eda1424d6aca91013 100644 (file)
@@ -77,11 +77,7 @@ class Cron
 
                while ($entry = DBA::fetch($entries)) {
                        if (!posix_kill($entry["pid"], 0)) {
-                               DBA::update(
-                                       'workerqueue',
-                                       ['executed' => DBA::NULL_DATETIME, 'pid' => 0],
-                                       ['id' => $entry["id"]]
-                               );
+                               DBA::update('workerqueue', ['executed' => DBA::NULL_DATETIME, 'pid' => 0], ['id' => $entry["id"]]);
                        } else {
                                // Kill long running processes
 
@@ -117,10 +113,7 @@ class Cron
                                        } elseif ($entry['priority'] != PRIORITY_CRITICAL) {
                                                $new_priority = PRIORITY_NEGLIGIBLE;
                                        }
-                                       DBA::update(
-                                               'workerqueue',
-                                               ['executed' => DBA::NULL_DATETIME, 'created' => DateTimeFormat::utcNow(), 'priority' => $new_priority, 'pid' => 0],
-                                               ['id' => $entry["id"]]
+                                       DBA::update('workerqueue', ['executed' => DBA::NULL_DATETIME, 'created' => DateTimeFormat::utcNow(), 'priority' => $new_priority, 'pid' => 0], ['id' => $entry["id"]]
                                        );
                                } else {
                                        Logger::info('Process runtime is okay', ['duration' => number_format($duration, 3), 'max' => $max_duration, 'id' => $entry["id"], 'pid' => $entry["pid"], 'command' => $command]);
@@ -172,7 +165,7 @@ class Cron
                                $priority = PRIORITY_MEDIUM;
                        } elseif ($delivery['failed'] < 8) {
                                $priority = PRIORITY_LOW;
-                       } {
+                       } else {
                                $priority = PRIORITY_NEGLIGIBLE;
                        }