mirror of
https://github.com/bitwarden/server.git
synced 2025-03-02 04:11:04 +01:00
Remove rollback
This commit is contained in:
parent
f462ef2ab5
commit
bcfe85220b
@ -262,37 +262,27 @@ public class UserRepository : Repository<User, Guid>, IUserRepository
|
|||||||
connection.Open();
|
connection.Open();
|
||||||
|
|
||||||
await using var transaction = connection.BeginTransaction();
|
await using var transaction = connection.BeginTransaction();
|
||||||
try
|
if (user.AccountRevisionDate == null)
|
||||||
{
|
{
|
||||||
if (user.AccountRevisionDate == null)
|
user.AccountRevisionDate = user.RevisionDate;
|
||||||
{
|
}
|
||||||
user.AccountRevisionDate = user.RevisionDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProtectData(user);
|
ProtectData(user);
|
||||||
await connection.ExecuteAsync(
|
await connection.ExecuteAsync(
|
||||||
$"[{Schema}].[{Table}_Update]",
|
$"[{Schema}].[{Table}_Update]",
|
||||||
user,
|
user,
|
||||||
transaction: transaction,
|
transaction: transaction,
|
||||||
commandType: CommandType.StoredProcedure);
|
commandType: CommandType.StoredProcedure);
|
||||||
|
|
||||||
// Update re-encrypted data
|
// Update re-encrypted data
|
||||||
foreach (var action in updateDataActions)
|
foreach (var action in updateDataActions)
|
||||||
{
|
|
||||||
await action(connection, transaction);
|
|
||||||
}
|
|
||||||
transaction.Commit();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
{
|
||||||
transaction.Rollback();
|
await action(connection, transaction);
|
||||||
throw;
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
connection.Close();
|
|
||||||
UnprotectData(user);
|
|
||||||
}
|
}
|
||||||
|
transaction.Commit();
|
||||||
|
|
||||||
|
connection.Close();
|
||||||
|
UnprotectData(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user