From 99aefa0cda4ec2a50080fc8b42110dce60cb6c50 Mon Sep 17 00:00:00 2001 From: Josh McCulloch Date: Thu, 27 Apr 2023 12:28:44 +1200 Subject: [PATCH] Added client timeout. (#32) --- pocketbase/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pocketbase/client.py b/pocketbase/client.py index 2604252..48a5999 100644 --- a/pocketbase/client.py +++ b/pocketbase/client.py @@ -35,10 +35,12 @@ class Client: base_url: str = "/", lang: str = "en-US", auth_store: BaseAuthStore | None = None, + timeout: float = 120, ) -> None: self.base_url = base_url self.lang = lang self.auth_store = auth_store or BaseAuthStore() # LocalAuthStore() + self.timeout = timeout # services self.admins = AdminService(self) self.collections = CollectionService(self) @@ -94,7 +96,7 @@ class Client: json=body, data=data, files=files, - timeout=120, + timeout=self.timeout, ) except Exception as e: raise ClientResponseError(