Skip to content

Commit

Permalink
Database: Reduce write concern.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsedla1o committed Jul 12, 2024
1 parent fed2dad commit bf6375c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dp3/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ def insert_datapoints(

master_col = self._master_col_name(etype)
try:
self._db[master_col].update_one({"_id": eid}, master_changes, upsert=True)
self._db.get_collection(master_col, write_concern=pymongo.WriteConcern(w=1)).update_one(
{"_id": eid}, master_changes, upsert=True
)
self.log.debug(f"Updated master record of {etype} {eid}: {master_changes}")
except Exception as e:
raise DatabaseError(f"Update of master record failed: {e}\n{dps}") from e
Expand Down

0 comments on commit bf6375c

Please sign in to comment.