Add additional checks for the worker

This commit is contained in:
Michael 2017-09-30 11:19:46 +00:00
parent cc7d5602a9
commit bd88179419
5 changed files with 36 additions and 1 deletions

View file

@ -1259,6 +1259,24 @@ class dba {
return $data;
}
/**
* @brief Returns the error number of the last query
*
* @return string Error number (0 if no error)
*/
public static function errorNo() {
return self::$dbo->errorno;
}
/**
* @brief Returns the error message of the last query
*
* @return string Error message ('' if no error)
*/
public static function errorMessage() {
return self::$dbo->error;
}
/**
* @brief Closes the current statement
*

View file

@ -248,7 +248,9 @@ function poller_execute($queue) {
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());
}
$poller_db_duration = (microtime(true) - $stamp);
} else {
logger("Function ".$funcname." does not exist");