From ee587654f9c15b3dc882653a46f919279557b03a Mon Sep 17 00:00:00 2001 From: Hoteres Date: Wed, 1 Jul 2026 01:22:38 +0800 Subject: [PATCH] add timeout for httpx_client --- openlist/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlist/__init__.py b/openlist/__init__.py index 0aefd0e..b8d4a72 100644 --- a/openlist/__init__.py +++ b/openlist/__init__.py @@ -42,10 +42,10 @@ async def main(): asyncio.run(main()) ``` """ - def __init__(self, base_url: str, auto_refresh: bool = True): + def __init__(self, base_url: str, auto_refresh: bool = True, timeout=None): self.context: Context = Context(base_url=base_url, auth_token=None, - httpx_client=httpx.AsyncClient(base_url=base_url, follow_redirects=True)) + httpx_client=httpx.AsyncClient(base_url=base_url, follow_redirects=True, timeout=timeout)) self.auth = Authentication(self.context) self.user = UserMe(self.context) self.fs = AsyncFileSystem(self.context)