X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fpoller.php;h=08e71fd486b69c23b68b52ee3e560b715e25c2e8;hb=92550861e9dc1294fd1a1822c575e3c905a783c2;hp=5560b3340e6209fc4ab82c97ecd3619bc9840afc;hpb=8f7d191bfca553f9d928666e7ef3b52a26911a8e;p=friendica.git diff --git a/include/poller.php b/include/poller.php index 5560b3340e..08e71fd486 100644 --- a/include/poller.php +++ b/include/poller.php @@ -1,4 +1,8 @@ start_process(); + if ($a->min_memory_reached()) { + return; + } + if (poller_max_connections_reached()) { return; } @@ -67,6 +73,11 @@ function poller_run($argv, $argc){ while ($r = poller_worker_process()) { + // Check free memory + if ($a->min_memory_reached()) { + return; + } + // Count active workers and compare them with a maximum value that depends on the load if (poller_too_much_workers()) { return; @@ -80,7 +91,6 @@ function poller_run($argv, $argc){ if (time() > ($starttime + 3600)) return; } - } /** @@ -678,4 +688,3 @@ if (array_search(__file__,get_included_files())===0){ killme(); } -?>