$parameters = json_encode($argv);
$found = dba::exists('workerqueue', array('parameter' => $parameters, 'done' => false));
+ // Quit if there was a database error - a precaution for the update process to 3.5.3
+ if (dba::errorNo() != 0) {
+ return;
+ }
+
if (!$found) {
dba::insert('workerqueue', array('parameter' => $parameters, 'created' => $created, 'priority' => $priority));
}
* **frontend_worker_timeout** - Value in minutes after we think that a frontend task was killed by the webserver. Default value is 10.
* **hsts** (Boolean) - Enables the sending of HTTP Strict Transport Security headers
* **ignore_cache** (Boolean) - For development only. Disables the item cache.
+* **ipv4_resolve** (Boolean) - Resolve IPV4 addresses only. Don't resolve to IPV6. Default value is false.
* **like_no_comment** (Boolean) - Don't update the "commented" value of an item when it is liked.
* **local_block** (Boolean) - Used in conjunction with "block_public".
* **local_search** (Boolean) - Blocks search for users who are not logged in to prevent crawlers from blocking your system.
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
*
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");
$warningtext[] = t('The database update failed. Please run "php include/dbstructure.php update" from the command line and have a look at the errors that might appear.');
}
+ $last_worker_call = Config::get('system', 'last_poller_execution', false);
+ if (!$last_worker_call) {
+ $showwarning = true;
+ $warningtext[] = t('The worker was never executed. Please check your database structure!');
+ } elseif ((strtotime(datetime_convert()) - strtotime($last_worker_call)) > 60 * 60) {
+ $showwarning = true;
+ $warningtext[] = sprintf(t('The last worker execution was on %s UTC. This is older than one hour. Please check your crontab settings.'), $last_worker_call);
+ }
+
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
$accounts = array(
array(t('Normal Account'), 0),