From d4d550d7bab6c9608240dd362ecd1801f4f059d9 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Tue, 11 Jun 2024 01:44:09 +0100 Subject: [PATCH] Add a proper timeout to is_online --- jimmy/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jimmy/config.py b/jimmy/config.py index b09d829..0641de6 100644 --- a/jimmy/config.py +++ b/jimmy/config.py @@ -27,7 +27,7 @@ class ServerConfig(BaseModel): """ Checks that the current server is online and responding to requests. """ - async with httpx.AsyncClient(base_url=str(self.base_url)) as client: + async with httpx.AsyncClient(base_url=str(self.base_url), timeout=httpx.Timeout(2.25)) as client: try: response = await client.get("/api/tags") return response.status_code == 200