diff --git a/main.py b/main.py index 5000045..fb21996 100644 --- a/main.py +++ b/main.py @@ -116,6 +116,13 @@ def main(self): ) resp.raise_for_status() if to_tag: + while True: + document_ref = self.client.documents.get(document.id) + time.sleep(10) + if ( + document_ref.status == "success" + ): # Break out of for loop if document status becomes success + break document.data["ocr_engine"] = "azure" document.save()