4
4
from gotrue import SyncMemoryStorage , SyncSupportedStorage
5
5
from httpx import Timeout
6
6
from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
7
+ from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
7
8
8
9
from supabase import __version__
9
10
@@ -36,9 +37,14 @@ class ClientOptions:
36
37
fetch : Optional [Callable ] = None
37
38
"""A custom `fetch` implementation."""
38
39
39
- timeout : Union [int , float , Timeout ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT
40
+ postgrest_client_timeout : Union [
41
+ int , float , Timeout
42
+ ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT
40
43
"""Timeout passed to the SyncPostgrestClient instance."""
41
44
45
+ storage_client_timeout : Union [int , float , Timeout ] = DEFAULT_STORAGE_CLIENT_TIMEOUT
46
+ """Timeout passed to the SyncStorageClient instance"""
47
+
42
48
def replace (
43
49
self ,
44
50
schema : Optional [str ] = None ,
@@ -48,7 +54,12 @@ def replace(
48
54
storage : Optional [SyncSupportedStorage ] = None ,
49
55
realtime : Optional [Dict [str , Any ]] = None ,
50
56
fetch : Optional [Callable ] = None ,
51
- timeout : Union [int , float , Timeout ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT ,
57
+ postgrest_client_timeout : Union [
58
+ int , float , Timeout
59
+ ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT ,
60
+ storage_client_timeout : Union [
61
+ int , float , Timeout
62
+ ] = DEFAULT_STORAGE_CLIENT_TIMEOUT ,
52
63
) -> "ClientOptions" :
53
64
"""Create a new SupabaseClientOptions with changes"""
54
65
client_options = ClientOptions ()
@@ -61,5 +72,10 @@ def replace(
61
72
client_options .storage = storage or self .storage
62
73
client_options .realtime = realtime or self .realtime
63
74
client_options .fetch = fetch or self .fetch
64
- client_options .timeout = timeout or self .timeout
75
+ client_options .postgrest_client_timeout = (
76
+ postgrest_client_timeout or self .postgrest_client_timeout
77
+ )
78
+ client_options .storage_client_timeout = (
79
+ storage_client_timeout or self .storage_client_timeout
80
+ )
65
81
return client_options
0 commit comments