Merge remote-tracking branch 'origin/upgrade-mongo-5-callbacks' into upgrade-mongo-5-callbacks

This commit is contained in:
Leonardo Venturini
2024-10-29 10:46:09 -04:00
2 changed files with 5 additions and 9 deletions

View File

@@ -226,14 +226,9 @@ export class OplogHandle {
);
try {
const isMasterDoc = await new Promise<any>((resolve, reject) => {
this._oplogLastEntryConnection!.db
.admin()
.command({ ismaster: 1 }, (err: Error | null, result: any) => {
if (err) reject(err);
else resolve(result);
});
});
const isMasterDoc = await this._oplogLastEntryConnection!.db
.admin()
.command({ ismaster: 1 });
if (!(isMasterDoc && isMasterDoc.setName)) {
throw new Error("$MONGO_OPLOG_URL must be set to the 'local' database of a Mongo replica set");
@@ -426,4 +421,4 @@ export function idForOp(op: OplogEntry): string {
} else {
throw Error("Unknown op: " + JSON.stringify(op));
}
}
}

View File

@@ -495,6 +495,7 @@ if (Meteor.isServer) {
self.handle = await cursor.observeChanges({
added: function(id, fields) {
self.xs.push(fields.x);
console.log('self.expects.length', self.expects);
test.notEqual(self.expects.length, 0);
self.expects.pop()();
},