Merge pull request #12774 from overleaf/ds-em-mongo-secondary-db-fix

Bug fix - Mongo DB secondary preference

GitOrigin-RevId: d9adc0a7e1ee5085b34c5c1ddfdc715967607fc3
This commit is contained in:
Jessica Lawshe
2023-04-27 08:56:31 -05:00
committed by Copybot
parent 42a52a0d96
commit 35c776b512
5 changed files with 18 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ const tk = require('timekeeper')
const moment = require('moment')
const { Project } = require('../helpers/models/Project')
const { DeletedProject } = require('../helpers/models/DeletedProject')
const { ObjectId } = require('mongodb')
const { ObjectId, ReadPreference } = require('mongodb')
const Errors = require('../../../../app/src/Features/Errors/Errors')
describe('ProjectDeleter', function () {
@@ -160,7 +160,11 @@ describe('ProjectDeleter', function () {
'../Collaborators/CollaboratorsGetter': this.CollaboratorsGetter,
'../Docstore/DocstoreManager': this.DocstoreManager,
'./ProjectDetailsHandler': this.ProjectDetailsHandler,
'../../infrastructure/mongodb': { db: this.db, ObjectId },
'../../infrastructure/mongodb': {
db: this.db,
ObjectId,
READ_PREFERENCE_SECONDARY: ReadPreference.secondaryPreferred.mode,
},
'../History/HistoryManager': this.HistoryManager,
'../../models/ProjectAuditLogEntry': {
ProjectAuditLogEntry: this.ProjectAuditLogEntry,