|
|
|
@ -8,6 +8,7 @@ import io
@@ -8,6 +8,7 @@ import io
|
|
|
|
|
import json |
|
|
|
|
import numpy as np |
|
|
|
|
import os |
|
|
|
|
import pymongo |
|
|
|
|
import signal |
|
|
|
|
import sys |
|
|
|
|
from datetime import datetime, timedelta |
|
|
|
@ -432,9 +433,14 @@ async def stream_wrapper(request):
@@ -432,9 +433,14 @@ async def stream_wrapper(request):
|
|
|
|
|
|
|
|
|
|
@app.route("/readyz") |
|
|
|
|
async def ready_check(request): |
|
|
|
|
if app.ctx.mask is not None: |
|
|
|
|
return response.text("OK") |
|
|
|
|
return response.text("Not enough frames", status=503) |
|
|
|
|
try: |
|
|
|
|
async for i in app.ctx.coll.find().limit(1): |
|
|
|
|
break |
|
|
|
|
except pymongo.errors.ServerSelectionTimeoutError: |
|
|
|
|
return response.text("MongoDB server selection timeout", status=503) |
|
|
|
|
if app.ctx.mask is None: |
|
|
|
|
return response.text("Not enough frames", status=503) |
|
|
|
|
return response.text("OK") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/event") |
|
|
|
|