require_once("boot.php");
function poller_run($argv, $argc){
require_once("boot.php");
function poller_run($argv, $argc){
- global $a, $db, $poller_up_start, $poller_db_duration;
+ global $a, $poller_up_start, $poller_db_duration;
- @include(".htconfig.php");
- require_once("include/dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
+ require_once ".htconfig.php";
+ require_once "include/dba.php";
+ dba::connect($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
Config::load();
unset($db_host, $db_user, $db_pass, $db_data);
Config::load();
// Quit when in maintenance
if (Config::get('system', 'maintenance', true)) {
return;
// Quit when in maintenance
if (Config::get('system', 'maintenance', true)) {
return;
poller_exec_function($queue, $funcname, $argv);
$stamp = (float)microtime(true);
poller_exec_function($queue, $funcname, $argv);
$stamp = (float)microtime(true);
- dba::update('workerqueue', array('done' => true), array('id' => $queue["id"]));
+ if (dba::update('workerqueue', array('done' => true), array('id' => $queue["id"]))) {
+ Config::set('system', 'last_poller_execution', datetime_convert());
+ }
// The higher the number of parallel workers, the more we prefetch to prevent concurring access
// We decrease the limit with the number of entries left in the queue
$worker_queues = Config::get("system", "worker_queues", 4);
// The higher the number of parallel workers, the more we prefetch to prevent concurring access
// We decrease the limit with the number of entries left in the queue
$worker_queues = Config::get("system", "worker_queues", 4);
poller_run($_SERVER["argv"],$_SERVER["argc"]);
poller_unclaim_process();
poller_run($_SERVER["argv"],$_SERVER["argc"]);
poller_unclaim_process();