Skip to content

Fix #814 #846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 24, 2024
4 changes: 3 additions & 1 deletion supabase/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ def storage(self):
def functions(self):
if self._functions is None:
self._functions = AsyncFunctionsClient(
self.functions_url, self.options.headers
self.functions_url,
self.options.headers,
self.options.function_client_timeout,
)
return self._functions

Expand Down
4 changes: 3 additions & 1 deletion supabase/_sync/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ def storage(self):
def functions(self):
if self._functions is None:
self._functions = SyncFunctionsClient(
self.functions_url, self.options.headers
self.functions_url,
self.options.headers,
self.options.function_client_timeout,
)
return self._functions

Expand Down
6 changes: 6 additions & 0 deletions supabase/lib/client_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from httpx import Timeout
from postgrest.constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
from storage3.constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
from supafunc.utils import DEFAULT_FUNCTION_CLIENT_TIMEOUT

from supabase import __version__

Expand Down Expand Up @@ -42,6 +43,11 @@ class ClientOptions:
storage_client_timeout: Union[int, float, Timeout] = DEFAULT_STORAGE_CLIENT_TIMEOUT
"""Timeout passed to the SyncStorageClient instance"""

function_client_timeout: Union[int, float, Timeout] = (
DEFAULT_FUNCTION_CLIENT_TIMEOUT
)
"""Timeout passed to the SyncFunctionsClient instance."""

flow_type: AuthFlowType = "implicit"
"""flow type to use for authentication"""

Expand Down