Skip to content

Commit

Permalink
Fix duplicate detection
Browse files Browse the repository at this point in the history
Corrector did not check if processed document already exists in clean_data after corrector started matching documents by xRequestId.

Adding duplicate detection.
  • Loading branch information
VitaliStupin committed Nov 28, 2023
1 parent f35e735 commit f10a640
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions corrector_module/opmon_corrector/corrector_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ def consume_data(self, data):
]

if clients:
matched_pair['client'] = clients[0]
if not self.db_m.check_clean_document_exists(x_request_id, clients[0]):
matched_pair['client'] = clients[0]

if producers:
matched_pair['producer'] = producers[0]
if not self.db_m.check_clean_document_exists(x_request_id, producers[0]):
matched_pair['producer'] = producers[0]

docs_to_remove = [
doc for doc in documents
Expand Down

0 comments on commit f10a640

Please sign in to comment.