WatchWebsite module: Avoid timeout when watching a website
This commit is contained in:
parent
d08273e832
commit
022879a4bf
@ -38,7 +38,10 @@ def unload(context):
|
|||||||
def getPageContent(url):
|
def getPageContent(url):
|
||||||
"""Returns the content of the given url"""
|
"""Returns the content of the given url"""
|
||||||
print_debug("Get page %s" % url)
|
print_debug("Get page %s" % url)
|
||||||
raw = urlopen(url, timeout=15)
|
try:
|
||||||
|
raw = urlopen(url, timeout=15)
|
||||||
|
except socket.timeout:
|
||||||
|
return None
|
||||||
return raw.read().decode()
|
return raw.read().decode()
|
||||||
|
|
||||||
def start_watching(site):
|
def start_watching(site):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user