X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FWorker.php;h=f3736d2573f7e10fbe4f934b42d434577380e7e3;hb=5a3991d4f7bc929c1087d9275716fc1c8cc299a6;hp=c053e32bc8859a25e1b32b0aabf6ab73d0f9bdbb;hpb=50da89d861dce3b648c8f9e5c1e4c480ee320a43;p=friendica.git diff --git a/src/Core/Worker.php b/src/Core/Worker.php index c053e32bc8..f3736d2573 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -668,9 +668,10 @@ class Worker DBA::close($processes); // Now adding all processes with workerqueue entries - $entries = DBA::p("SELECT COUNT(*) AS `entries`, `priority` FROM `workerqueue` WHERE NOT `done` GROUP BY `priority`"); + $entries = DBA::p("SELECT COUNT(*) AS `entries`, `priority` FROM `workerqueue` WHERE NOT `done` AND `next_try` < ? GROUP BY `priority`", DateTimeFormat::utcNow()); while ($entry = DBA::fetch($entries)) { - $processes = DBA::p("SELECT COUNT(*) AS `running` FROM `process` INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` AND NOT `done` WHERE `priority` = ?", $entry["priority"]); + $processes = DBA::p("SELECT COUNT(*) AS `running` FROM `process` INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` WHERE NOT `done` AND `next_try` < ? AND `priority` = ?", + DateTimeFormat::utcNow(), $entry["priority"]); if ($process = DBA::fetch($processes)) { $listitem[$entry["priority"]] = $entry["priority"].":".$process["running"]."/".$entry["entries"]; }