Skip to content

Commit def7044

Browse files
authored
Merge pull request #66 from ladyada/master
add longer default timeout (dashblock is slooow)
2 parents ad5cabf + 196ecab commit def7044

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_pyportal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def get_local_time(self, location=None):
621621
api_url = TIME_SERVICE % (aio_username, aio_key)
622622
api_url += TIME_SERVICE_STRFTIME
623623
try:
624-
response = requests.get(api_url)
624+
response = requests.get(api_url, timeout=10)
625625
if response.status_code != 200:
626626
raise ValueError(response.text)
627627
if self._debug:
@@ -798,7 +798,7 @@ def fetch(self, refresh_url=None):
798798
print("Retrieving data...", end='')
799799
self.neo_status((100, 100, 0)) # yellow = fetching data
800800
gc.collect()
801-
r = requests.get(self._url, headers=self._headers)
801+
r = requests.get(self._url, headers=self._headers, timeout=10)
802802
gc.collect()
803803
self.neo_status((0, 0, 100)) # green = got data
804804
print("Reply is OK!")

0 commit comments

Comments
 (0)