ciderpunx / twitrssme

TwitRSS.me: Tool to make Twittter timelines and searches into RSS feeds
https://twitrss.me
GNU General Public License v2.0
359 stars 59 forks source link

Twitter fetch failure info & configurable timeout #65

Open sdt opened 5 years ago

sdt commented 5 years ago

If the twitter get fails, add the response message to the existing "can't screenscrape twitter" message and return the response error code.

My local instance gets polled every 20 mins from a rss2imap cron job. Lately I've been getting sporadic 404 failures, but clicking through the same link then works fine.

I added this to try to track down what's going wrong. Turns out they've all been timeout errors.

To that end, this PR also adds a TWITRSSME_TIMEOUT_SEC environment variable, which allows this to be customised. The original value of 2 seconds is left as a default.

In the Apache config, the -idle-timeout and -appConnTimeout would need to be increased to handle the longer app timeout. For the docker startup, the apache config file is now dynamically created, and these values get set as appropriate.

It may of course just be simpler to increase the hardcoded 2, but I assume your live version had the low timeout value for a reason.