Skip to content

Commit

Permalink
Add a timeout to wifi driver get()
Browse files Browse the repository at this point in the history
  • Loading branch information
bill88t committed Aug 4, 2024
1 parent 026d116 commit bbbbf50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/driver_wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ def ping(self, host=str):
"""
return wifi.radio.ping(self.resolve(host))

def get(self, host: str):
def get(self, host: str, timeout: int = 6):
"""
HTTP Get
"""
if self._session is not None:
if not (host.startswith("http://") or host.startswith("https://")):
host = "http://" + host

return self._session.get(host)
return self._session.get(host, timeout=timeout)
else:
return None

Expand Down

0 comments on commit bbbbf50

Please sign in to comment.