@@ -94,7 +94,7 @@ async def make_request(
9494 # Use Basic Auth with service account credentials
9595 auth = httpx .BasicAuth (username , secret )
9696
97- async with httpx .AsyncClient () as client :
97+ async with httpx .AsyncClient (timeout = 30.0 ) as client :
9898 if method .upper () == "POST" :
9999 response = await client .post (url , auth = auth , headers = headers , json = data , params = params )
100100 elif method .upper () == "GET" :
@@ -153,7 +153,7 @@ async def make_request(
153153 # MIXPANEL_EXPORT_ENDPOINT already includes the full path /api/2.0/export
154154 url = MIXPANEL_EXPORT_ENDPOINT
155155
156- async with httpx .AsyncClient () as client :
156+ async with httpx .AsyncClient (timeout = 30.0 ) as client :
157157 if method .upper () == "GET" :
158158 response = await client .get (url , auth = auth , headers = headers , params = params )
159159 elif method .upper () == "POST" :
@@ -215,7 +215,7 @@ async def make_request(
215215
216216 url = f"{ MIXPANEL_QUERY_ENDPOINT } { endpoint } "
217217
218- async with httpx .AsyncClient () as client :
218+ async with httpx .AsyncClient (timeout = 30.0 ) as client :
219219 if method .upper () == "GET" :
220220 response = await client .get (url , auth = auth , headers = headers , params = params )
221221 elif method .upper () == "POST" :
@@ -271,7 +271,7 @@ async def make_request(
271271
272272 url = f"{ MIXPANEL_APP_ENDPOINT } { endpoint } "
273273
274- async with httpx .AsyncClient () as client :
274+ async with httpx .AsyncClient (timeout = 30.0 ) as client :
275275 if method .upper () == "GET" :
276276 response = await client .get (url , auth = auth , headers = headers , params = params )
277277 elif method .upper () == "POST" :
0 commit comments