Skip to content

Commit

Permalink
Exchange hard-coded wait time before retry with value from parameter …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
OskarHofmann committed Aug 12, 2024
1 parent 09740e1 commit 35ea2ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/market_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def get_order_prices(self, session: aiohttp.ClientSession, n_tries: int =
for _ in range(n_tries):
async with session.get(url=api_url, params=api_params) as response:
if response.status != 200:
await asyncio.sleep(1)
await asyncio.sleep(params.SECONDS_BEFORE_RETRY_API_CALL)
continue
response_json = await response.json(content_type=None)

Expand Down
4 changes: 2 additions & 2 deletions libs/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async def delete_order_async(session: aiohttp.ClientSession, n_tries:int,
for _ in range(n_tries):
async with session.delete(url=api_url, headers = auth_header) as response:
if response.status != 200:
await asyncio.sleep(1)
await asyncio.sleep(params.SECONDS_BEFORE_RETRY_API_CALL)
continue
return True
else:
Expand Down Expand Up @@ -116,7 +116,7 @@ async def create_order_async(session: aiohttp.ClientSession, n_tries: int,
for _ in range(n_tries):
async with session.post(url=api_url, json=api_params, headers = auth_header) as response:
if response.status != 200:
await asyncio.sleep(1)
await asyncio.sleep(params.SECONDS_BEFORE_RETRY_API_CALL)
continue
response_json = await response.json(content_type=None)

Expand Down

0 comments on commit 35ea2ee

Please sign in to comment.