Skip to content

Commit

Permalink
added retry strategy on 202 cache miss for PDF generator
Browse files Browse the repository at this point in the history
  • Loading branch information
janlukasschroeder committed Oct 16, 2024
1 parent 05b5846 commit fc4bbe8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sec_api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def get_pdf(self, url):
response = requests.get(_url, proxies=self.proxies)
if response.status_code == 200:
return response.content
elif response.status_code == 429:
elif response.status_code == 429 or response.status_code == 202:
# wait 500 * (x + 1) milliseconds and try again
time.sleep(0.5 * (x + 1))
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="sec-api",
version="1.0.24",
version="1.0.25",
author="SEC API",
author_email="[email protected]",
description="SEC EDGAR Filings API",
Expand Down

0 comments on commit fc4bbe8

Please sign in to comment.