potential fixes for userpurge

This commit is contained in:
rootdarkarchon
2022-12-14 17:36:28 +01:00
parent 2b56e3245b
commit 87fdd55c50
3 changed files with 24 additions and 21 deletions

View File

@@ -316,7 +316,7 @@ public partial class MareHub
{
_logger.LogCallInfo(MareHubLogger.Args(gid, "Deleted"));
_dbContext.Remove(group);
_dbContext.Groups.Remove(group);
}
else
{

View File

@@ -40,7 +40,7 @@ public partial class MareHub
await _authServiceClient.RemoveAuthAsync(new UidMessage() { Uid = userid }).ConfigureAwait(false);
_dbContext.RemoveRange(ownPairData);
_dbContext.ClientPairs.RemoveRange(ownPairData);
await _dbContext.SaveChangesAsync().ConfigureAwait(false);
var otherPairData = await _dbContext.ClientPairs.Include(u => u.User)
.Where(u => u.OtherUser.UID == userid).AsNoTracking().ToListAsync().ConfigureAwait(false);
@@ -60,9 +60,9 @@ public partial class MareHub
_mareMetrics.IncCounter(MetricsAPI.CounterUsersRegisteredDeleted, 1);
_dbContext.RemoveRange(otherPairData);
_dbContext.Remove(userEntry);
_dbContext.Remove(auth);
_dbContext.ClientPairs.RemoveRange(otherPairData);
_dbContext.Users.Remove(userEntry);
_dbContext.Auth.Remove(auth);
await _dbContext.SaveChangesAsync().ConfigureAwait(false);
}