Skip to content

Commit fc4bbe8

Browse files
added retry strategy on 202 cache miss for PDF generator
1 parent 05b5846 commit fc4bbe8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sec_api/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def get_pdf(self, url):
169169
response = requests.get(_url, proxies=self.proxies)
170170
if response.status_code == 200:
171171
return response.content
172-
elif response.status_code == 429:
172+
elif response.status_code == 429 or response.status_code == 202:
173173
# wait 500 * (x + 1) milliseconds and try again
174174
time.sleep(0.5 * (x + 1))
175175
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="sec-api",
8-
version="1.0.24",
8+
version="1.0.25",
99
author="SEC API",
1010
author_email="support@sec-api.io",
1111
description="SEC EDGAR Filings API",

0 commit comments

Comments
 (0)