def on_get(self, req, resp):
if not self.healthcheck_path:
logger.error('Healthcheck path not set')
raise falcon.HTTPNotFound()
try:
with open(self.healthcheck_path) as f:
health = f.readline().strip()
except IOError:
raise falcon.HTTPNotFound()
resp.status = falcon.HTTP_200
resp.content_type = 'text/plain'
resp.body = health
评论列表
文章目录