Skip to content

Commit 688e82a

Browse files
authored
docs: add Timeout Chain documentation (#1176)
1 parent 2bc4b07 commit 688e82a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/content/docs/web-application/reference/env-variables.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,17 @@ description: "Configuration reference for html2rss-web environment variables."
2020
| `ASYNC_FEED_REFRESH_STALE_FACTOR` | optional integer `>= 1`; default `3` |
2121
| `PORT` | app listen port; compose uses `4000` |
2222
| `RACK_ENV` | Rack environment; quickstart uses `development`, production examples use `production` |
23+
| `RACK_TIMEOUT_SERVICE_TIMEOUT` | optional; total web-request timeout in seconds; default `30` |
24+
| `HTML2RSS_TOTAL_TIMEOUT_SECONDS` | optional; internal gem request timeout in seconds; default `25` |
25+
26+
## Timeout Chain
27+
28+
When fetching feeds from complex websites, multiple components work together. To prevent premature request termination, ensure your timeouts are configured in a "chain" where the outer layers wait longer than the inner layers.
29+
30+
For an overall 30-second budget:
31+
32+
1. **Botasaurus Scraper (`SCRAPE_TIMEOUT_SECONDS`)**: Set to **20s**. This is the time allowed for the browser to fetch and render the page.
33+
2. **html2rss Gem (`HTML2RSS_TOTAL_TIMEOUT_SECONDS`)**: Set to **25s**. This allows the gem enough time to wait for Botasaurus and process the results.
34+
3. **html2rss-web (`RACK_TIMEOUT_SERVICE_TIMEOUT`)**: Set to **30s**. This is the total time the web server will wait before killing the request.
2335

2436
Older environment-variable examples from previous docs revisions are obsolete. Use only the supported table above and the `Environment & Runtime Flags` table in [`docs/README.md`](https://github.com/html2rss/html2rss-web/blob/main/docs/README.md).

0 commit comments

Comments
 (0)