Skip to content

Commit

Permalink
Merge pull request #1491 from nationalarchives/ensure-we-send-a-doc-t…
Browse files Browse the repository at this point in the history
…o-reparse

Ensure we send at least one document to be reparsed
  • Loading branch information
dragon-dxw authored Jul 1, 2024
2 parents 108649f + 83116ed commit f765f5c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ def handle(self, *args, **options):
),
)

for document_details in document_details_to_parse[:NUMBER_TO_PARSE]:
counter = 0
for document_details in document_details_to_parse:
document_uri = document_details[0]

document = api_client.get_document_by_uri(document_uri.replace(".xml", ""))

self.stdout.write(f"Attempting to reparse document {document.name}...")
if document.reparse():
self.stdout.write("Reparse request sent.")
counter += 1
else:
self.stdout.write("Reparse not sent.")

if counter >= NUMBER_TO_PARSE:
break

0 comments on commit f765f5c

Please sign in to comment.