@@ -88,6 +88,7 @@ def __init__(
88
88
timeout = DEFAULT_TIMEOUT ,
89
89
user_agent : str = None ,
90
90
organization_id : int = None ,
91
+ session_pool_size = DEFAULT_SESSION_POOL_SIZE ,
91
92
):
92
93
self .auth = auth
93
94
self .verify = verify
@@ -96,6 +97,7 @@ def __init__(
96
97
self .url_port = port
97
98
self .url_path_prefix = url_path_prefix
98
99
self .url_protocol = protocol
100
+ self .session_pool_size = session_pool_size
99
101
100
102
def construct_api_url ():
101
103
params = {
@@ -118,7 +120,7 @@ def construct_api_url():
118
120
119
121
self .user_agent = user_agent or f"{ __appname__ } /{ __version__ } "
120
122
121
- self .s = niquests .Session ()
123
+ self .s = niquests .Session (pool_maxsize = session_pool_size )
122
124
self .s .headers ["User-Agent" ] = self .user_agent
123
125
124
126
self .organization_id = organization_id
@@ -230,6 +232,7 @@ def __init__(
230
232
timeout = DEFAULT_TIMEOUT ,
231
233
user_agent : str = None ,
232
234
organization_id : int = None ,
235
+ session_pool_size = DEFAULT_SESSION_POOL_SIZE ,
233
236
):
234
237
super ().__init__ (
235
238
auth ,
@@ -241,8 +244,9 @@ def __init__(
241
244
timeout = timeout ,
242
245
user_agent = user_agent ,
243
246
organization_id = organization_id ,
247
+ session_pool_size = session_pool_size ,
244
248
)
245
- self .s = niquests .AsyncSession ()
249
+ self .s = niquests .AsyncSession (pool_maxsize = session_pool_size )
246
250
self .s .headers .setdefault ("Connection" , "keep-alive" )
247
251
248
252
def __getattr__ (self , item ):
0 commit comments