From 15e0ee5bc58f773acd44394763d85f6124ad41d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Fri, 2 Dec 2022 19:03:16 +0200 Subject: [PATCH] Separate readiness check from health check --- camdetect.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/camdetect.py b/camdetect.py index c301b83..6e02f98 100755 --- a/camdetect.py +++ b/camdetect.py @@ -500,6 +500,13 @@ async def stream_wrapper(request): @app.route("/readyz") async def ready_check(request): + if app.ctx.mask is None: + return response.text("Not enough frames", status=503) + return response.text("OK") + + +@app.route("/healthz") +async def health_check(request): if app.ctx.mask is None: return response.text("Not enough frames", status=503)