Skip to content

Commit

Permalink
Merge pull request #540 from OpenMined/timeout_environment
Browse files Browse the repository at this point in the history
Added environment variable for client timeout
  • Loading branch information
abyesilyurt authored Feb 4, 2025
2 parents a35fddc + e529b49 commit b355c57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syftbox/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def from_config(
base_url=str(config.server_url),
follow_redirects=True,
headers=cls._make_headers(config),
timeout=10,
timeout=config.client_timeout,
transport=transport,
)
return cls(conn)
3 changes: 3 additions & 0 deletions syftbox/lib/client_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class SyftClientConfig(BaseModel):
path: Path = Field(exclude=True, description="Path to the config file")
"""Path to the config file"""

client_timeout: float = Field(default=5, description="Timeout used by the client connection to the SyftBox server")
"""Timeout used by the client connection to the SyftBox server"""

@field_validator("client_url", mode="before")
def port_to_url(cls, val: Union[int, str]) -> Optional[str]:
if isinstance(val, int):
Expand Down

0 comments on commit b355c57

Please sign in to comment.