Skip to content

Commit

Permalink
move timeout to client (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaromagnoli authored Nov 15, 2024
1 parent f53aafa commit 54c532d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dataservice/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ async def _make_request(self, request: Request) -> Response:

try:
logger.debug(f"Requesting {request.url_encoded}")
pw_response = await page.goto(request.url)
# Playwright page.goto() timeout is in milliseconds
pw_response = await page.goto(request.url, timeout=request.timeout * 1000)
logger.debug(f"Received response for {request.url_encoded}")
self._raise_for_status(pw_response.status, pw_response.status_text)

Expand Down
3 changes: 0 additions & 3 deletions dataservice/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ class ServiceConfig(BaseModel):
delay: DelayConfig = Field(
description="The delay configuration", default_factory=DelayConfig
)
timeout: Seconds = Field(
default=Seconds(30), description="The timeout for requests in seconds."
)


class ProxyConfig(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "python-dataservice"
packages = [
{ include = "dataservice"},
]
version = "0.11.9"
version = "0.11.10"
description = "Lightweight async data gathering for Python"
authors = ["NomadMonad <[email protected]>"]
readme = "README.rst"
Expand Down

0 comments on commit 54c532d

Please sign in to comment.