Added documentation, config stuff, ...

This commit is contained in:
Michael 2016-11-27 09:02:08 +00:00
parent d71321c834
commit 636a033364
3 changed files with 10 additions and 4 deletions

View file

@ -30,6 +30,7 @@ Example: To set the directory value please add this line to your .htconfig.php:
* disable_url_validation (Boolean) - Disables the DNS lookup of an URL. * disable_url_validation (Boolean) - Disables the DNS lookup of an URL.
* event_input_format - Default value is "ymd". * 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 (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. * 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. * 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_block (Boolean) - Used in conjunction with "block_public".

View file

@ -523,10 +523,11 @@ function call_worker_if_idle() {
* @brief Removes long running worker processes * @brief Removes long running worker processes
*/ */
function clear_worker_processes() { function clear_worker_processes() {
/// @todo the 10 minutes needs to be configurable $timeout = Config::get("system", "frontend_worker_timeout", 10);
/// Additionally we should clean up the corresponding workerqueue entries as well
/// @todo We should clean up the corresponding workerqueue entries as well
q("DELETE FROM `process` WHERE `created` < '%s' AND `command` = 'worker.php'", 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")));
} }
/** /**

View file

@ -1,4 +1,8 @@
<?php <?php
/**
* @file mod/worker.php
* @brief Module for running the poller as frontend process
*/
require_once("include/poller.php"); require_once("include/poller.php");
use \Friendica\Core\Config; use \Friendica\Core\Config;
@ -6,7 +10,7 @@ use \Friendica\Core\PConfig;
function worker_init($a){ function worker_init($a){
if (!get_config("system", "frontend_worker")) { if (!Config::get("system", "frontend_worker")) {
return; return;
} }