]> git.mxchange.org Git - friendica.git/commitdiff
Use a 10 minute timeout for high priority processes. This may be better.
authorMichael Vogel <icarus@dabo.de>
Mon, 8 Aug 2016 19:28:44 +0000 (21:28 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 8 Aug 2016 19:28:44 +0000 (21:28 +0200)
include/poller.php

index d838df77973e55819f2c4459ced8df6794ca4816..ecdb9eb0d3b2cd11ed6cae934e3c4f387762a3ad 100644 (file)
@@ -217,7 +217,7 @@ function poller_max_connections_reached() {
  *
  */
 function poller_kill_stale_workers() {
-       $r = q("SELECT `pid`, `executed`, `priority` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'");
+       $r = q("SELECT `pid`, `executed`, `priority`, `parameter` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'");
 
        if (!dbm::is_result($r)) {
                // No processing here needed
@@ -236,13 +236,13 @@ function poller_kill_stale_workers() {
                                $pid["priority"] = PRIORITY_MEDIUM;
 
                        // Define the maximum durations
-                       $max_duration_defaults = array(PRIORITY_SYSTEM => 360, PRIORITY_HIGH => 5, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180);
+                       $max_duration_defaults = array(PRIORITY_SYSTEM => 360, PRIORITY_HIGH => 10, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180);
                        $max_duration = $max_duration_defaults[$pid["priority"]];
 
                        // How long is the process already running?
                        $duration = (time() - strtotime($pid["executed"])) / 60;
                        if ($duration > $max_duration) {
-                               logger("Worker process ".$pid["pid"]." took more than ".$max_duration." minutes. It will be killed now.");
+                               logger("Worker process ".$pid["pid"]." (".$pid["parameter"].") took more than ".$max_duration." minutes. It will be killed now.");
                                posix_kill($pid["pid"], SIGTERM);
 
                                // We killed the stale process.