Skip to content

Commit

Permalink
Allow exceptions to pass through MongoDB insert many
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Nov 16, 2024
1 parent bef08aa commit 43ef254
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion optimade/server/entry_collections/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def insert(self, data: list[EntryResource]) -> None:
data: The entry resource objects to add to the database.
"""
self.collection.insert_many(data, ordered=False)
try:
self.collection.insert_many(data, ordered=False)
except Exception:
pass

Check warning on line 107 in optimade/server/entry_collections/mongo.py

View check run for this annotation

Codecov / codecov/patch

optimade/server/entry_collections/mongo.py#L106-L107

Added lines #L106 - L107 were not covered by tests

def create_index(self, fields: str | set[str], unique: bool = False) -> None:
"""Create an index on the given fields.
Expand Down

0 comments on commit 43ef254

Please sign in to comment.