Skip to content

Commit 267ec11

Browse files
committed
Minor cleanup.
1 parent 225af87 commit 267ec11

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/module-mongodb/src/replication/MongoRelation.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ function filterJsonData(data: any, depth = 0): any {
146146
export async function createCheckpoint(client: mongo.MongoClient, db: mongo.Db): Promise<string> {
147147
const session = client.startSession();
148148
try {
149-
const result = await db.collection(CHECKPOINTS_COLLECTION).findOneAndUpdate(
149+
// Note: If multiple PowerSync instances are replicating the same source database,
150+
// they'll modify the same checkpoint document. This is fine - it could create
151+
// more replication load than required, but won't break anything.
152+
await db.collection(CHECKPOINTS_COLLECTION).findOneAndUpdate(
150153
{
151154
_id: 'checkpoint' as any
152155
},
@@ -160,7 +163,6 @@ export async function createCheckpoint(client: mongo.MongoClient, db: mongo.Db):
160163
}
161164
);
162165
const time = session.operationTime!;
163-
// console.log('marked checkpoint at', time, getMongoLsn(time));
164166
// TODO: Use the above when we support custom write checkpoints
165167
return getMongoLsn(time);
166168
} finally {

0 commit comments

Comments
 (0)