]> git.mxchange.org Git - friendica.git/commitdiff
No processing if error or empty array
authorRoland Haeder <roland@mxchange.org>
Fri, 4 Mar 2016 21:38:18 +0000 (22:38 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 4 Mar 2016 21:38:18 +0000 (22:38 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
include/poller.php

index 90e94ede9e05af23ba0bd56791569bbc6e0e1125..755862eb6bf32d51247967890910d951aed4d26a 100644 (file)
@@ -205,6 +205,12 @@ function poller_max_connections_reached() {
  */
 function poller_kill_stale_workers() {
        $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)
                if (!posix_kill($pid["pid"], 0))
                        q("UPDATE `workerqueue` SET `executed` = '0000-00-00 00:00:00', `pid` = 0 WHERE `pid` = %d",