From e31a43c8b3bde792fba1f44179a0913955ebee55 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:18:01 -0300 Subject: [PATCH 1/7] Fix edge functions timeout --- tests/_sync/clients.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/_sync/clients.py b/tests/_sync/clients.py index 8b4b3f8..b4770fe 100644 --- a/tests/_sync/clients.py +++ b/tests/_sync/clients.py @@ -23,4 +23,5 @@ def function_client(): "apiKey": mock_access_token(), "Authorization": f"Bearer {mock_access_token()}", }, + timeout = 10 ) From 6fdab911cf093fbfc2034dd0bc64caac6cee660f Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:18:23 -0300 Subject: [PATCH 2/7] Fix edge functions timeout --- supabase_functions/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supabase_functions/utils.py b/supabase_functions/utils.py index fbdd194..15af53d 100644 --- a/supabase_functions/utils.py +++ b/supabase_functions/utils.py @@ -3,6 +3,8 @@ __version__ = "0.4.6" +DEFAULT_FUNCTION_CLIENT_TIMEOUT = 5 + class SyncClient(BaseClient): def aclose(self) -> None: From 7c1564819391fc2bd7e0b9e87fc8e4d51cd396ae Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:18:48 -0300 Subject: [PATCH 3/7] Fix edge functions timeout --- supabase_functions/_sync/functions_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/supabase_functions/_sync/functions_client.py b/supabase_functions/_sync/functions_client.py index bb39a6f..a47f638 100644 --- a/supabase_functions/_sync/functions_client.py +++ b/supabase_functions/_sync/functions_client.py @@ -7,7 +7,7 @@ class SyncFunctionsClient: - def __init__(self, url: str, headers: Dict, verify: bool = True): + def __init__(self, url: str, headers: Dict, timeout: int, verify: bool = True): self.url = url self.headers = { "User-Agent": f"supabase-py/functions-py v{__version__}", @@ -18,6 +18,7 @@ def __init__(self, url: str, headers: Dict, verify: bool = True): headers=self.headers, verify=bool(verify), follow_redirects=True, + timeout=timeout, ) def _request( From 1b84370767c2886dc753b3d2174459f489f50f56 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:19:43 -0300 Subject: [PATCH 4/7] Fix edge functions timeout --- tests/_sync/clients.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/_sync/clients.py b/tests/_sync/clients.py index b4770fe..14da8b5 100644 --- a/tests/_sync/clients.py +++ b/tests/_sync/clients.py @@ -23,5 +23,5 @@ def function_client(): "apiKey": mock_access_token(), "Authorization": f"Bearer {mock_access_token()}", }, - timeout = 10 + timeout=10, ) From 16fe0323e9f6873e4490fe16b84a39342f636416 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:36:22 -0300 Subject: [PATCH 5/7] Fix edge functions timeout --- supabase_functions/_async/functions_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/supabase_functions/_async/functions_client.py b/supabase_functions/_async/functions_client.py index 8e84acd..c981458 100644 --- a/supabase_functions/_async/functions_client.py +++ b/supabase_functions/_async/functions_client.py @@ -7,7 +7,7 @@ class AsyncFunctionsClient: - def __init__(self, url: str, headers: Dict, verify: bool = True): + def __init__(self, url: str, headers: Dict, timeout: int, verify: bool = True): self.url = url self.headers = { "User-Agent": f"supabase-py/functions-py v{__version__}", @@ -19,6 +19,7 @@ def __init__(self, url: str, headers: Dict, verify: bool = True): verify=bool(verify), follow_redirects=True, http2=True, + timeout=timeout, ) async def _request( From 05861ff429e4c1f25fe8b39632f3bbe9d982a583 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:36:30 -0300 Subject: [PATCH 6/7] Fix edge functions timeout --- tests/_async/clients.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/_async/clients.py b/tests/_async/clients.py index 23a7d9f..38526a6 100644 --- a/tests/_async/clients.py +++ b/tests/_async/clients.py @@ -23,4 +23,5 @@ def function_client(): "apiKey": mock_access_token(), "Authorization": f"Bearer {mock_access_token()}", }, + timeout=10, ) From 5a87f4461c153fa1b17a32c71b14235e8e2d4a9d Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Fri, 12 Jul 2024 18:37:54 -0300 Subject: [PATCH 7/7] Fix edge functions timeout --- supabase_functions/_async/functions_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supabase_functions/_async/functions_client.py b/supabase_functions/_async/functions_client.py index c981458..0e24bca 100644 --- a/supabase_functions/_async/functions_client.py +++ b/supabase_functions/_async/functions_client.py @@ -17,9 +17,9 @@ def __init__(self, url: str, headers: Dict, timeout: int, verify: bool = True): base_url=self.url, headers=self.headers, verify=bool(verify), + timeout=timeout, follow_redirects=True, http2=True, - timeout=timeout, ) async def _request(