Skip to content

Commit

Permalink
ratel imit image download (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswittich authored Oct 31, 2024
1 parent 3cbbd59 commit 285160f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions learning_loop_node/data_exchanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ async def download_images(self, image_uuids: List[str], image_folder: str, chunk

async def _download_one_image(self, path: str, image_id: str, image_folder: str) -> None:
response = await self.loop_communicator.get(path)
if response.status_code == 429:
await asyncio.sleep(1)
response = await self.loop_communicator.get(path)
if response.status_code != HTTPStatus.OK:
logging.error(f'bad status code {response.status_code} for {path}. Details: {response.text}')
return
Expand Down

0 comments on commit 285160f

Please sign in to comment.