Added request timeouts
connection timeout to 5 seconds and the response timeout to 10 PyLint W3101
This commit is contained in:
parent
96b19172a1
commit
7d2efe5acb
@ -73,7 +73,8 @@ class FirecrawlApp:
|
|||||||
response = requests.post(
|
response = requests.post(
|
||||||
f'{self.api_url}/v0/scrape',
|
f'{self.api_url}/v0/scrape',
|
||||||
headers=headers,
|
headers=headers,
|
||||||
json=scrape_params
|
json=scrape_params,
|
||||||
|
timeout=(5,10)
|
||||||
)
|
)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
response = response.json()
|
response = response.json()
|
||||||
@ -111,7 +112,8 @@ class FirecrawlApp:
|
|||||||
response = requests.post(
|
response = requests.post(
|
||||||
f'{self.api_url}/v0/search',
|
f'{self.api_url}/v0/search',
|
||||||
headers=headers,
|
headers=headers,
|
||||||
json=json_data
|
json=json_data,
|
||||||
|
timeout=(5,10)
|
||||||
)
|
)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
response = response.json()
|
response = response.json()
|
||||||
|
Loading…
Reference in New Issue
Block a user