Skip to content

Commit

Permalink
Fetch document after patch
Browse files Browse the repository at this point in the history
  • Loading branch information
duckduckgrayduck authored Sep 27, 2024
1 parent d400e0c commit bf0865c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bf0865c

Please sign in to comment.