mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
adapt callback to promise that block tests
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user