mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
Merge pull request #35432 from overleaf/em-change-library-mongo-cluster-migration-script
Copy library collections to the auxiliary Mongo cluster GitOrigin-RevId: 87c0433b4345fdaa3fe3c141af888eaa0106ea45
This commit is contained in:
@@ -254,6 +254,18 @@ export async function getCollectionInternal(name) {
|
||||
return internalDb.collection(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* Direct access to a collection on the auxiliary Mongo cluster, bypassing
|
||||
* the dual-write mirror in `db`. For use by data-migration scripts that need
|
||||
* to write to the auxiliary cluster without also writing to the primary one.
|
||||
*/
|
||||
export async function getAuxCollectionInternal(name) {
|
||||
if (!auxInternalDb) {
|
||||
throw new OError('no auxiliary Mongo cluster configured')
|
||||
}
|
||||
return auxInternalDb.collection(name)
|
||||
}
|
||||
|
||||
export async function waitForDb() {
|
||||
await connectionPromise
|
||||
await auxConnectionPromise
|
||||
|
||||
Reference in New Issue
Block a user