diff --git a/main.py b/main.py index a1299d5..d43a270 100644 --- a/main.py +++ b/main.py @@ -63,8 +63,9 @@ def main(self): resp = self.client.patch(f"documents/{document.id}/", json={"pages": chunk}) resp.raise_for_status() while True: + document_ref = self.client.documents.get(document.id) time.sleep(15) - if document.status == "success": # Break out of for loop if document status becomes success + if document_ref.status == "success": # Break out of for loop if document status becomes success break if to_tag: document.data["ocr_engine"]="doctr"