Skip to content

Commit 4d83ba1

Browse files
authored
Merge pull request #74 from virgilvox/master
Add timeout override
2 parents fbeab7f + 1961f99 commit 4d83ba1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_pyportal.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def push_to_io(self, feed_key, data):
853853
continue
854854
break
855855

856-
def fetch(self, refresh_url=None):
856+
def fetch(self, refresh_url=None, timeout=10):
857857
"""Fetch data from the url we initialized with, perfom any parsing,
858858
and display text or graphics. This function does pretty much everything
859859
Optionally update the URL
@@ -879,7 +879,7 @@ def fetch(self, refresh_url=None):
879879
print("Retrieving data...", end="")
880880
self.neo_status((100, 100, 0)) # yellow = fetching data
881881
gc.collect()
882-
r = requests.get(self._url, headers=self._headers, timeout=10)
882+
r = requests.get(self._url, headers=self._headers, timeout=timeout)
883883
gc.collect()
884884
self.neo_status((0, 0, 100)) # green = got data
885885
print("Reply is OK!")

0 commit comments

Comments
 (0)