janlukasschroeder / sec-api-python

Python SEC EDGAR Filings API. Over 18 million filings, all 150 filing types supported. Query, full-text search and real-time stream API. Convert XBRL-to-JSON and access standardized financial statements from 10-K and 10-Q filings.
https://sec-api.io
MIT License
181 stars 24 forks source link

Timeout on requests #11

Closed SamStephens closed 3 weeks ago

SamStephens commented 3 weeks ago

All usages of requests are done without a timeout (for example here is the QueryApi request). As per the requests documentation, "Nearly all production code should use this parameter in nearly all requests. Failure to do so can cause your program to hang indefinitely".

I'm making requests from AWS Lambda. What I'm encountering is that sporadically my Lambda hangs until it times out. I'm not sure what the cause is, but if I was getting requests.exceptions.Timeout thrown from requests, I'd be able to retry the request after a timeout.

janlukasschroeder commented 3 weeks ago

Absolutely. Refer to https://github.com/janlukasschroeder/sec-api-python/issues/12