Skip to content

Commit

Permalink
copied request_timeout conventions to get_timeout method
Browse files Browse the repository at this point in the history
  • Loading branch information
mishushakov committed Dec 26, 2024
1 parent 81c1f81 commit 3edaa2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/python-sdk/e2b/sandbox_async/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,17 @@ async def set_timeout( # type: ignore
**self.connection_config.__dict__,
)

async def get_timeout(self) -> datetime: # type: ignore
async def get_timeout( # type: ignore
self,
request_timeout: Optional[float] = None,
) -> datetime:
config_dict = self.connection_config.__dict__
config_dict.pop("access_token", None)
config_dict.pop("api_url", None)

if request_timeout:
config_dict["request_timeout"] = request_timeout

sbx = await SandboxApi.get(
sandbox_id=self.sandbox_id,
**self.connection_config.__dict__,
Expand Down
4 changes: 4 additions & 0 deletions packages/python-sdk/e2b/sandbox_sync/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,15 @@ def set_timeout( # type: ignore

def get_timeout( # type: ignore
self,
request_timeout: Optional[float] = None,
) -> datetime:
config_dict = self.connection_config.__dict__
config_dict.pop("access_token", None)
config_dict.pop("api_url", None)

if request_timeout:
config_dict["request_timeout"] = request_timeout

sbx = SandboxApi.get(
sandbox_id=self.sandbox_id,
**self.connection_config.__dict__,
Expand Down

0 comments on commit 3edaa2b

Please sign in to comment.