Skip to content

Commit

Permalink
Increase random delay
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimon committed Jan 8, 2025
1 parent dea11fc commit 956be73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apitally/client/client_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async def send_sync_data(self, client: httpx.AsyncClient) -> None:
try:
if time.time() - data["timestamp"] <= MAX_QUEUE_TIME:
if i > 0:
await asyncio.sleep(random.uniform(0.1, 0.3))
await asyncio.sleep(random.uniform(0.1, 0.5))

Check warning on line 114 in apitally/client/client_asyncio.py

View check run for this annotation

Codecov / codecov/patch

apitally/client/client_asyncio.py#L114

Added line #L114 was not covered by tests
await self._send_sync_data(client, data)
i += 1
except httpx.HTTPError:
Expand Down
2 changes: 1 addition & 1 deletion apitally/client/client_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def send_sync_data(self, session: requests.Session) -> None:
try:
if time.time() - data["timestamp"] <= MAX_QUEUE_TIME:
if i > 0:
time.sleep(random.uniform(0.1, 0.3))
time.sleep(random.uniform(0.1, 0.5))

Check warning on line 125 in apitally/client/client_threading.py

View check run for this annotation

Codecov / codecov/patch

apitally/client/client_threading.py#L125

Added line #L125 was not covered by tests
self._send_sync_data(session, data)
i += 1
except requests.RequestException:
Expand Down

0 comments on commit 956be73

Please sign in to comment.