From bae4569a0b5c59c26e25f25d71734fb27e31e64b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 2 Jul 2017 19:43:36 +0000 Subject: [PATCH] Avoid the killing of the wrong process --- include/poller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/poller.php b/include/poller.php index 934641c13c..50d883644d 100644 --- a/include/poller.php +++ b/include/poller.php @@ -228,7 +228,7 @@ function poller_execute($queue) { if (function_exists($funcname)) { - // We constantly update the "executed" date every minute to avoid being killed to soon + // We constantly update the "executed" date every minute to avoid being killed too soon if (!isset($poller_last_update)) { $poller_last_update = strtotime($queue["executed"]); } @@ -470,7 +470,7 @@ function poller_max_connections_reached() { * */ function poller_kill_stale_workers() { - $entries = dba::p("SELECT `pid`, `executed`, `priority`, `parameter` FROM `workerqueue` WHERE `executed` > ? AND NOT `done` AND `pid` != 0", NULL_DATE); + $entries = dba::p("SELECT `pid`, `executed`, `priority`, `parameter` FROM `workerqueue` WHERE `executed` > ? AND NOT `done` AND `pid` != 0 ORDER BY `priority`, `created`", NULL_DATE); while ($entry = dba::fetch($entries)) { if (!posix_kill($entry["pid"], 0)) { -- 2.39.5