diff --git a/doc/htconfig.md b/doc/htconfig.md index 8e0b890926..dbdbf15033 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 f65134023d..b8e14a0965 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 1d1ab2af33..1375799667 100644 --- a/mod/worker.php +++ b/mod/worker.php @@ -1,4 +1,8 @@