From bf0865ca90131cf4ef01c21ed8a2357d6f801d54 Mon Sep 17 00:00:00 2001 From: Sanjin <102841251+duckduckgrayduck@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:20:01 -0500 Subject: [PATCH] Fetch document after patch --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"