Change timeout if called from PHP.

This commit is contained in:
Pecusx
2017-01-08 15:43:48 +01:00
committed by GitHub
parent c424103629
commit 61d145ce43
+7 -1
View File
@@ -455,9 +455,15 @@ for line in open(StationList,'r'):
filenumber += 1
continue
# Set timeout depending on the parameter
if deleteOld:
timeo = 1
else:
timeo = 10
# Get the published URL to the stream file
try:
file = urllib2.urlopen(url)
file = urllib2.urlopen(url, timeout=timeo)
data = file.read()
file.close()
# Creat list from data