Skip to content

Commit

Permalink
Reload document between patches
Browse files Browse the repository at this point in the history
  • Loading branch information
duckduckgrayduck committed Sep 27, 2024
1 parent bb2665d commit 8b6ee9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ def main(self):
page_chunk_size = 50 # Set your desired chunk size
for i in range(0, len(pages), page_chunk_size):
while True:
document_ref = self.client.documents.get(document.id)
time.sleep(10)
if (
document.status == "success"
document_ref.status == "success"
): # Break out of for loop if document status becomes success
break
chunk = pages[i : i + page_chunk_size]
Expand Down

0 comments on commit 8b6ee9f

Please sign in to comment.