Skip to content

Commit

Permalink
Make api retries configurable via env variable (#184)
Browse files Browse the repository at this point in the history
Make api retries configurable via env variable
  • Loading branch information
WieslerAA authored Sep 25, 2024
1 parent 5b4f776 commit 8eecd0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def sync_client() -> Client:
return Client(
token=get_env_var("TEST_TOKEN"),
host=get_env_var("TEST_API_URL"),
# This will retry after [0.0, 0.5, 1.0, 2.0, 4.0] seconds
total_retries=5,
# This will retry after [0.0, 0.25, 0.5, 1.0, 2.0] seconds
total_retries=int(os.environ.get("TEST_API_RETRIES", "5")),
)


Expand All @@ -21,8 +21,8 @@ async def async_client() -> AsyncIterable[AsyncClient]:
async with AsyncClient(
token=get_env_var("TEST_TOKEN"),
host=get_env_var("TEST_API_URL"),
# This will retry after [0.0, 0.5, 1.0, 2.0, 4.0] seconds
total_retries=5,
# This will retry after [0.0, 0.25, 0.5, 1.0, 2.0] seconds
total_retries=int(os.environ.get("TEST_API_RETRIES", "5")),
) as client:
yield client

Expand Down

0 comments on commit 8eecd0b

Please sign in to comment.