Skip to content

Commit

Permalink
fixed: write consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
primalmotion committed Dec 13, 2018
1 parent c430ce8 commit ea001c6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions manipmongo/manipulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,12 @@ func (s *mongoManipulator) makeSession(
) (*mgo.Collection, func()) {

session := s.rootSession.Copy()
mrc := convertReadConsistency(readConsistency)
if mrc != -1 {

if mrc := convertReadConsistency(readConsistency); mrc != -1 {
session.SetMode(mrc, true)
}

mwc := convertWriteConsistency(writeConsistency)
if mrc != -1 {
session.SetSafe(mwc)
}
session.SetSafe(convertWriteConsistency(writeConsistency))

return session.DB(s.dbName).C(identity.Name), session.Close
}

0 comments on commit ea001c6

Please sign in to comment.