From a7d8331d29b0e556c102cffd018b25172e85841f Mon Sep 17 00:00:00 2001 From: zkldi Date: Wed, 16 Jun 2021 13:39:51 +0100 Subject: [PATCH] Fix undocumented issue with monk --- server/src/lib/score-import/framework/import-locks/lock.ts | 6 ++++-- server/src/utils/db.ts | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/lib/score-import/framework/import-locks/lock.ts b/server/src/lib/score-import/framework/import-locks/lock.ts index 06e53a065..dd9ae628e 100644 --- a/server/src/lib/score-import/framework/import-locks/lock.ts +++ b/server/src/lib/score-import/framework/import-locks/lock.ts @@ -13,11 +13,13 @@ export function GetOrSetUserLock(userID: integer) { userID, }, { - userID, + $set: { userID }, }, { upsert: true, - returnDocument: "before", + // this is marked as deprecated, but it shouldn't be, as returnDocument: "before" + // does nothing. + returnOriginal: true, } ); } diff --git a/server/src/utils/db.ts b/server/src/utils/db.ts index 58c9c4e5b..28b0c37c0 100644 --- a/server/src/utils/db.ts +++ b/server/src/utils/db.ts @@ -14,6 +14,8 @@ export async function GetNextCounterValue(counterName: string): Promise }, }, { + // this is marked as deprecated, but it shouldn't be, as returnDocument: "before" + // does nothing. returnOriginal: true, } );