From 636a0333646b0ca941a3eadaa246002001915303 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 27 Nov 2016 09:02:08 +0000 Subject: [PATCH] Added documentation, config stuff, ... --- doc/htconfig.md | 1 + include/poller.php | 7 ++++--- mod/worker.php | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/htconfig.md b/doc/htconfig.md index 8e0b89092..dbdbf1503 100644 --- a/doc/htconfig.md +++ b/doc/htconfig.md @@ -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". diff --git a/include/poller.php b/include/poller.php index f65134023..b8e14a096 100644 --- a/include/poller.php +++ b/include/poller.php @@ -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"))); } /** diff --git a/mod/worker.php b/mod/worker.php index 1d1ab2af3..137579966 100644 --- a/mod/worker.php +++ b/mod/worker.php @@ -1,4 +1,8 @@