Skip to content

Commit

Permalink
Add higher httpx timeout in boefjes
Browse files Browse the repository at this point in the history
  • Loading branch information
dekkers committed Oct 29, 2024
1 parent 8e1881f commit e084073
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion boefjes/boefjes/clients/scheduler_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from httpx import Client, HTTPTransport, Response
from pydantic import BaseModel, TypeAdapter

from boefjes.config import settings
from boefjes.job_models import BoefjeMeta, NormalizerMeta


Expand Down Expand Up @@ -57,7 +58,7 @@ def push_item(self, p_item: Task) -> None:

class SchedulerAPIClient(SchedulerClientInterface):
def __init__(self, base_url: str):
self._session = Client(base_url=base_url, transport=HTTPTransport(retries=6))
self._session = Client(base_url=base_url, transport=HTTPTransport(retries=6), timeout=settings.httpx_timeout)

@staticmethod
def _verify_response(response: Response) -> None:
Expand Down
2 changes: 2 additions & 0 deletions boefjes/boefjes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ class Settings(BaseSettings):

logging_format: Literal["text", "json"] = Field("text", description="Logging format")

httpx_timeout: int = Field(30, description="httpx timeout")

model_config = SettingsConfigDict(env_prefix="BOEFJES_")

@classmethod
Expand Down

0 comments on commit e084073

Please sign in to comment.