Skip to content

Commit

Permalink
add check interval sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Apr 14, 2024
1 parent 5e72798 commit 2bf33ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llama_parse/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ async def _get_job_result(
raise Exception(f"Timeout while parsing the file: {job_id}")
if verbose and tries % 10 == 0:
print(".", end="", flush=True)

await asyncio.sleep(self.check_interval)

continue

# Allowed values "PENDING", "SUCCESS", "ERROR", "CANCELED"
Expand All @@ -299,6 +302,9 @@ async def _get_job_result(
raise Exception(f"Timeout while parsing the file: {job_id}")
if verbose and tries % 10 == 0:
print(".", end="", flush=True)

await asyncio.sleep(self.check_interval)

continue
else:
raise Exception(
Expand Down

0 comments on commit 2bf33ee

Please sign in to comment.