Skip to content

Commit

Permalink
feat: add health check
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Feb 21, 2022
1 parent 2a60ae5 commit c32919b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doppelgaenger-websocket/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from dotenv import load_dotenv
from logzero import logger
from bson import json_util
from healthcheck import TornadoHandler, HealthCheck

health = HealthCheck()


class ChangesHandler(tornado.websocket.WebSocketHandler):
Expand Down Expand Up @@ -75,6 +78,10 @@ def main():
app = tornado.web.Application(
[
(r"/socket", ChangesHandler),
(
"/health",
TornadoHandler, dict(checker=health)
),
(
r"/(.*)", tornado.web.StaticFileHandler,
{"path": "templates/", "default_filename": "index.html"}
Expand Down
1 change: 1 addition & 0 deletions doppelgaenger-websocket/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dnspython
logzero
python-dotenv
bson
py-healthcheck

0 comments on commit c32919b

Please sign in to comment.