feat: standardize timeout values to floats in seconds (#1766)

This commit is contained in:
Yugan 2025-12-19 17:52:56 +05:30 • committed by GitHub
commit 2aa1ad2a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 49 deletions

View file

@ -29,7 +29,6 @@ import json
import logging
import os
import sys
from datetime import timedelta
from urllib.parse import ParseResult, parse_qs, urlparse
import httpx
@ -263,8 +262,8 @@ async def _run_session(server_url: str, oauth_auth: OAuthClientProvider) -> None
async with streamablehttp_client(
url=server_url,
auth=oauth_auth,
timeout=timedelta(seconds=30),
sse_read_timeout=timedelta(seconds=60),
timeout=30.0,
sse_read_timeout=60.0,
) as (read_stream, write_stream, _):
async with ClientSession(read_stream, write_stream) as session:
# Initialize the session

View file

@ -207,7 +207,7 @@ class SimpleAuthClient:
async with sse_client(
url=self.server_url,
auth=oauth_auth,
timeout=60,
timeout=60.0,
) as (read_stream, write_stream):
await self._run_session(read_stream, write_stream, None)
else: