]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
Fixes E_WARNING from foreach() because count() seem to return TRUE even when $r is...
[friendica.git] / include / poller.php
index 90e94ede9e05af23ba0bd56791569bbc6e0e1125..558eda25ffbcfd2eefb827c25dc65b32e56c9c71 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_filled_array($r)) {
+               // 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",