]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
proc_run was replaced
[friendica.git] / include / poller.php
index a18d10b3c6b4dcdd571e14eb52578a4e3877720b..6eb04971c39844e4dacfac370b75da374653a397 100644 (file)
@@ -42,6 +42,15 @@ function poller_run($argv, $argc) {
 
        load_hooks();
 
+       // At first check the maximum load. We shouldn't continue with a high load
+       if ($a->maxload_reached()) {
+               logger('Pre check: maximum load reached, quitting.', LOGGER_DEBUG);
+               return;
+       }
+
+       // We now start the process. This is done after the load check since this could increase the load.
+       $a->start_process();
+
        $run_cron = (($argc <= 1) || ($argv[1] != "no_cron"));
 
        Worker::processQueue($run_cron);