1
1
Fork 0

Merge remote-tracking branch 'upstream/develop' into 1602-diaspora

This commit is contained in:
Michael Vogel 2016-03-06 08:41:24 +01:00
commit 305f6f9a7b
10 changed files with 166 additions and 22 deletions

View 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",