MCPcopy Create free account
hub / github.com/python-websockets/websockets / health_check

Function health_check

example/deployment/kubernetes/app.py:20–30  ·  view source on GitHub ↗
(connection, request)

Source from the content-addressed store, hash-verified

18
19
20def health_check(connection, request):
21 if request.path == "/healthz":
22 return connection.respond(http.HTTPStatus.OK, "OK\n")
23 if request.path == "/inemuri":
24 loop = asyncio.get_running_loop()
25 loop.call_later(1, time.sleep, 10)
26 return connection.respond(http.HTTPStatus.OK, "Sleeping for 10s\n")
27 if request.path == "/seppuku":
28 loop = asyncio.get_running_loop()
29 loop.call_later(1, sys.exit, 69)
30 return connection.respond(http.HTTPStatus.OK, "Terminating\n")
31
32
33async def main():

Callers

nothing calls this directly

Calls 1

respondMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…