Browse Source

Added documentation, config stuff, ...

pull/2975/head
Michael 4 years ago
parent
commit
636a033364
3 changed files with 10 additions and 4 deletions
  1. +1
    -0
      doc/htconfig.md
  2. +4
    -3
      include/poller.php
  3. +5
    -1
      mod/worker.php

+ 1
- 0
doc/htconfig.md 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.
* 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".


+ 4
- 3
include/poller.php View File

@ -523,10 +523,11 @@ function call_worker_if_idle() {
* @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")));
}
/**


+ 5
- 1
mod/worker.php View File

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


Loading…
Cancel
Save