No processing if error or empty array
Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
parent
066ddada17
commit
d5c1ce490b
1 changed files with 6 additions and 0 deletions
|
@ -205,6 +205,12 @@ function poller_max_connections_reached() {
|
||||||
*/
|
*/
|
||||||
function poller_kill_stale_workers() {
|
function poller_kill_stale_workers() {
|
||||||
$r = q("SELECT `pid`, `executed` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'");
|
$r = q("SELECT `pid`, `executed` FROM `workerqueue` WHERE `executed` != '0000-00-00 00:00:00'");
|
||||||
|
|
||||||
|
if (!is_array($r) || count($r) == 0) {
|
||||||
|
// No processing here needed
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($r AS $pid)
|
foreach($r AS $pid)
|
||||||
if (!posix_kill($pid["pid"], 0))
|
if (!posix_kill($pid["pid"], 0))
|
||||||
q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `pid` = 0 WHERE `pid` = %d",
|
q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `pid` = 0 WHERE `pid` = %d",
|
||||||
|
|
Loading…
Reference in a new issue