]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
rework autocomplete: space after inserting contact without id
[friendica.git] / include / poller.php
index 755862eb6bf32d51247967890910d951aed4d26a..b0e88f73dd00e37948aaf86e537d86b088b45d11 100644 (file)
@@ -29,17 +29,8 @@ function poller_run(&$argv, &$argc){
        if (poller_max_connections_reached())
                return;
 
-       $load = current_load();
-       if($load) {
-               $maxsysload = intval(get_config('system','maxloadavg'));
-               if($maxsysload < 1)
-                       $maxsysload = 50;
-
-               if(intval($load) > $maxsysload) {
-                       logger('system: load ' . $load . ' too high. poller deferred to next scheduled run.');
-                       return;
-               }
-       }
+       if (App::maxload_reached())
+               return;
 
        // Checking the number of workers
        if (poller_too_much_workers(1)) {
@@ -206,7 +197,7 @@ 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) {
+       if (!dba::is_result($r)) {
                // No processing here needed
                return;
        }