Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter fetch failure info & configurable timeout #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sdt
Copy link
Contributor

@sdt sdt commented Nov 2, 2018

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.

If the twitter get fails, provide a little more info in the error
message. This adds the response message and the 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 works fine.

I added this to try to track down what's going wrong. Turns out they've
all been timeout errors.
From the previous commit, I discovered my sporadic failures were all
timeouts. Hardcoding this to 10 seconds made them go away.

This environment variable allows the default 2 seconds to be overridden.

I don't know if this needs a corresponding change in the Apache config.
I notice the `-appConnTimeout 3` in the apache config.
If the TWITRSSME_TIMEOUT_SEC value gets increased, the apache config
timeouts need to increase as well.

Rather than use a hardcoded apache.conf, create one on the fly using
computed environment variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant