Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
kingh0730 committed Nov 15, 2023
1 parent f8a1f66 commit a2bf2e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Discovery/Client/discovery_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# PyPi Imports
import dotenv
import httpx
from httpx._types import TimeoutTypes

# Workspace Imports
# from discovery_shared.git import GitInfo
Expand All @@ -38,6 +39,7 @@ class Config:

server_url: str = "localhost:8000"
enable_https: bool = True
timeout: TimeoutTypes = 60.0


# Create the module-scope configuration
Expand Down Expand Up @@ -102,6 +104,7 @@ def f(inp: rpc.input_type, *, rpc=rpc) -> rpc.return_type:
os.environ.get("DISCOVERY_USERNAME"),
os.environ.get("DISCOVERY_API_KEY"),
),
timeout=config.timeout,
)
return rpc.return_type(**resp.json())

Expand Down

0 comments on commit a2bf2e0

Please sign in to comment.