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

@@ -20,7 +20,7 @@ const modulePath = path.join(
'../../../../app/src/Features/InactiveData/InactiveProjectManager'
)
const { expect } = require('chai')
const { ObjectId } = require('mongodb')
const { ObjectId, ReadPreference } = require('mongodb')
describe('InactiveProjectManager', function () {
beforeEach(function () {
@@ -42,6 +42,10 @@ describe('InactiveProjectManager', function () {
'../Project/ProjectUpdateHandler': this.ProjectUpdateHandler,
'../Project/ProjectGetter': this.ProjectGetter,
'../../models/Project': {},
'../../infrastructure/mongodb': {
ObjectId,
READ_PREFERENCE_SECONDARY: ReadPreference.secondaryPreferred.mode,
},
},
})
return (this.project_id = '1234')