Skip to content

Commit f765f5c

Browse files
authored
Merge pull request #1491 from nationalarchives/ensure-we-send-a-doc-to-reparse
Ensure we send at least one document to be reparsed
2 parents 108649f + 83116ed commit f765f5c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

judgments/management/commands/reparse_next_in_reparse_queue.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@ def handle(self, *args, **options):
1818
),
1919
)
2020

21-
for document_details in document_details_to_parse[:NUMBER_TO_PARSE]:
21+
counter = 0
22+
for document_details in document_details_to_parse:
2223
document_uri = document_details[0]
2324

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

2627
self.stdout.write(f"Attempting to reparse document {document.name}...")
2728
if document.reparse():
2829
self.stdout.write("Reparse request sent.")
30+
counter += 1
2931
else:
3032
self.stdout.write("Reparse not sent.")
33+
34+
if counter >= NUMBER_TO_PARSE:
35+
break

0 commit comments

Comments
 (0)