Add request timeout
This commit is contained in:
parent
c7ef9fb1e8
commit
920fdb5955
1 changed files with 6 additions and 1 deletions
|
|
@ -8,7 +8,12 @@ import time
|
|||
|
||||
|
||||
def send_open_door_request(host, username, password):
|
||||
urllib3.PoolManager().request(
|
||||
urllib3.PoolManager(
|
||||
timeout=urllib3.Timeout(
|
||||
connect=3.0,
|
||||
read=300,
|
||||
)
|
||||
).request(
|
||||
"GET",
|
||||
f"http://{host}/local/Doorcom/door.cgi?r=1",
|
||||
headers=urllib3.make_headers(basic_auth=f"{username}:{password}"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue