Add timeouts to requests calls (#76851)
This commit is contained in:
parent
4eb4146e29
commit
1faabb8f40
7 changed files with 13 additions and 7 deletions
|
@ -87,7 +87,7 @@ def _create_processor_from_config(hass, camera_entity, config):
|
|||
def _get_default_classifier(dest_path):
|
||||
"""Download the default OpenCV classifier."""
|
||||
_LOGGER.info("Downloading default classifier")
|
||||
req = requests.get(CASCADE_URL, stream=True)
|
||||
req = requests.get(CASCADE_URL, stream=True, timeout=10)
|
||||
with open(dest_path, "wb") as fil:
|
||||
for chunk in req.iter_content(chunk_size=1024):
|
||||
if chunk: # filter out keep-alive new chunks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue