Skip to content

Commit

Permalink
Attempt a crude wait before tagging the document
Browse files Browse the repository at this point in the history
  • Loading branch information
duckduckgrayduck committed Dec 20, 2024
1 parent 8b6ee9f commit 7c6e8d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 7c6e8d6

Please sign in to comment.