feat: refs #6023 Added SELECT FOR UPDATE

This commit is contained in:
Guillermo Bonet 2023-11-10 11:55:37 +01:00
parent 9f92bc4b4c
commit b7da144967
1 changed files with 7 additions and 0 deletions

View File

@ -48,6 +48,13 @@ module.exports = Self => {
if (tx) await tx.rollback(); if (tx) await tx.rollback();
return; return;
} }
await Self.rawSql(`
SELECT id
FROM account.user
WHERE id = ?
FOR UPDATE`, [user.id], myOptions);
await models.AccountConfig.syncUser(userName, password); await models.AccountConfig.syncUser(userName, password);
await models.UserSync.destroyById(userName, myOptions); await models.UserSync.destroyById(userName, myOptions);
if (tx) await tx.commit(); if (tx) await tx.commit();