Skip to content

Commit 088785b

Browse files
committed
Added healthcheck handler support to RPC framework
1 parent 367aeaa commit 088785b

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lf_toolkit/io/handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ async def handle_preview(self, req: dict):
5757

5858
return await self._call_user_handler("preview", response, request_params)
5959

60+
async def handle_healthcheck(self, req: dict):
61+
from .healthcheck import run_healthcheck
62+
return await anyio.to_thread.run_sync(run_healthcheck)
63+
6064
async def handle(self, name: Command, req: dict) -> dict:
6165
handler = getattr(self, f"handle_{name}", None)
6266

lf_toolkit/io/rpc_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class JsonRpcHandler(Handler):
1212

1313
def __init__(self):
1414
self._methods = {
15-
name: jsonrpc_handler(self, name) for name in ["eval", "preview"]
15+
name: jsonrpc_handler(self, name) for name in ["eval", "preview", "healthcheck"]
1616
}
1717

1818
async def dispatch(self, req: str) -> str:

0 commit comments

Comments
 (0)