Skip to content

Commit

Permalink
delete duplicate messages in database
Browse files Browse the repository at this point in the history
  • Loading branch information
slatinsky committed Aug 27, 2023
1 parent a0fea70 commit 34d0bbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/preprocess/JsonFileStreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_exported_at(self) -> str:
latestTimestamp = value

if latestTimestamp is not None:
print(f' warning: exportedAt filend not found, using estimated value {latestTimestamp}. Use DCE v2.40.1 or newer')
print(f' warning: exportedAt field not found, using estimated value {latestTimestamp}. Use DCE v2.40.1 or newer')
return latestTimestamp

print(' ERROR: exportedAt not found, using current time')
Expand Down
3 changes: 1 addition & 2 deletions backend/preprocess/JsonProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,7 @@ def process(self):
existing_messages = self.collection_messages.find({"_id": {"$in": message_ids}})

print(' removing existing messages')
for existing_message in existing_messages:
message_ids.remove(existing_message["_id"])
self.collection_messages.delete_many({"_id": {"$in": message_ids}})

messages = self.merge_messages(list(messages), list(existing_messages))

Expand Down

0 comments on commit 34d0bbb

Please sign in to comment.