* disable_url_validation (Boolean) - Disables the DNS lookup of an URL.
* event_input_format - Default value is "ymd".
* frontend_worker (Boolean) - Activates the frontend worker which acts as a replacement for running the poller via the command line.
+* frontend_worker_timeout - Value in minutes after we think that a frontend task was killed by the webserver. Default value is 10.
* ignore_cache (Boolean) - For development only. Disables the item cache.
* 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".
* @brief Removes long running worker processes
*/
function clear_worker_processes() {
- /// @todo the 10 minutes needs to be configurable
- /// Additionally we should clean up the corresponding workerqueue entries as well
+ $timeout = Config::get("system", "frontend_worker_timeout", 10);
+
+ /// @todo We should clean up the corresponding workerqueue entries as well
q("DELETE FROM `process` WHERE `created` < '%s' AND `command` = 'worker.php'",
- dbesc(datetime_convert('UTC','UTC',"now - 10 minutes")));
+ dbesc(datetime_convert('UTC','UTC',"now - ".$timeout." minutes")));
}
/**
<?php
+/**
+ * @file mod/worker.php
+ * @brief Module for running the poller as frontend process
+ */
require_once("include/poller.php");
use \Friendica\Core\Config;
function worker_init($a){
- if (!get_config("system", "frontend_worker")) {
+ if (!Config::get("system", "frontend_worker")) {
return;
}