Merge branch '2.5.x' into 2.5.x-saas
Conflicts: python_apps/pypo/listenerstat.py
This commit is contained in:
commit
02a96646e1
27 changed files with 15828 additions and 73 deletions
|
@ -11,4 +11,4 @@ SCRIPT=`readlink -f $0`
|
|||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
cd ${SCRIPTPATH}/../
|
||||
timeout 45 python pyponotify.py "$@"
|
||||
timeout --signal=KILL 45 python pyponotify.py "$@"
|
||||
|
|
|
@ -10,6 +10,9 @@ import time
|
|||
from api_clients import api_client
|
||||
|
||||
class ListenerStat(Thread):
|
||||
|
||||
HTTP_REQUEST_TIMEOUT = 30 # 30 second HTTP request timeout
|
||||
|
||||
def __init__(self, config, logger=None):
|
||||
Thread.__init__(self)
|
||||
self.config = config
|
||||
|
@ -47,7 +50,7 @@ class ListenerStat(Thread):
|
|||
url=url,
|
||||
headers=header)
|
||||
|
||||
f = urllib2.urlopen(req)
|
||||
f = urllib2.urlopen(req, timeout=ListenerStat.HTTP_REQUEST_TIMEOUT)
|
||||
document = f.read()
|
||||
|
||||
return document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue