Remove some unnecessary error handling in healthcheck
...as well as an unused class variable. Change-Id: If1091f420b0bcf34c37e49b13f59b229e8deecc6
This commit is contained in:
parent
3944d82038
commit
365171395e
@ -31,7 +31,6 @@ class HealthCheckMiddleware(object):
|
|||||||
|
|
||||||
def __init__(self, app, conf):
|
def __init__(self, app, conf):
|
||||||
self.app = app
|
self.app = app
|
||||||
self.conf = conf
|
|
||||||
self.disable_path = conf.get('disable_path', '')
|
self.disable_path = conf.get('disable_path', '')
|
||||||
|
|
||||||
def GET(self, req):
|
def GET(self, req):
|
||||||
@ -45,15 +44,11 @@ class HealthCheckMiddleware(object):
|
|||||||
|
|
||||||
def __call__(self, env, start_response):
|
def __call__(self, env, start_response):
|
||||||
req = Request(env)
|
req = Request(env)
|
||||||
try:
|
|
||||||
if req.path == '/healthcheck':
|
if req.path == '/healthcheck':
|
||||||
handler = self.GET
|
handler = self.GET
|
||||||
if self.disable_path and os.path.exists(self.disable_path):
|
if self.disable_path and os.path.exists(self.disable_path):
|
||||||
handler = self.DISABLED
|
handler = self.DISABLED
|
||||||
return handler(req)(env, start_response)
|
return handler(req)(env, start_response)
|
||||||
except UnicodeError:
|
|
||||||
# definitely, this is not /healthcheck
|
|
||||||
pass
|
|
||||||
return self.app(env, start_response)
|
return self.app(env, start_response)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user