From 8b6ee9f91401d8d64f73c485ad3960ceee466dab Mon Sep 17 00:00:00 2001 From: duckduckgrayduck <102841251+duckduckgrayduck@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:00:38 -0500 Subject: [PATCH] Reload document between patches --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index be8a684..5000045 100644 --- a/main.py +++ b/main.py @@ -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]