sebinsua/scrape-twitter

Network Timeout Error On Large Queries

straley opened this issue · 1 comments

Hi,

I'm getting a FetchError: network timeout error. I found this goes away, if I add an exceptionally long timeout at the lines

return fetcher(resource, { agent: https.globalAgent })
and
return fetcher(resource, { agent: https.globalAgent })
, like:

    return fetcher(resource, { agent: https.globalAgent, timeout: 120000 })

It would be great to have a setting to set this timeout or make it part of the TweetStream options.

Hi, I'm going to make it so that you can pass in the environment variable SCRAPE_TWITTER_TIMEOUT (but set this to 10s by default.)