<?php
+
+use Friendica\App;
+use Friendica\Core\Config;
+
if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);
chdir($directory);
}
-use \Friendica\Core\Config;
-
require_once("boot.php");
function poller_run($argv, $argc){
global $a, $db;
- if(is_null($a)) {
- $a = new App;
+ if (is_null($a)) {
+ $a = new App(dirname(__DIR__));
}
if(is_null($db)) {
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;
if (time() > ($starttime + 3600))
return;
}
-
}
/**
killme();
}
-?>