From c4cb52e69842095883db5210728cbe24709ce99c Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Wed, 14 Dec 2022 17:47:51 +0100 Subject: [PATCH] always remove user from grouppairs during purge --- .../MareSynchronosServices/CleanupService.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/MareSynchronosServer/MareSynchronosServices/CleanupService.cs b/MareSynchronosServer/MareSynchronosServices/CleanupService.cs index 97164f9..f05e7ea 100644 --- a/MareSynchronosServer/MareSynchronosServices/CleanupService.cs +++ b/MareSynchronosServer/MareSynchronosServices/CleanupService.cs @@ -167,13 +167,11 @@ public class CleanupService : IHostedService, IDisposable } else { - var groupHasMigrated = await SharedDbFunctions.MigrateOrDeleteGroup(dbContext, userGroupPair.Group, groupPairs, _configuration.GetValue("MaxExistingGroupsByUser", 3)).ConfigureAwait(false); + _ = await SharedDbFunctions.MigrateOrDeleteGroup(dbContext, userGroupPair.Group, groupPairs, _configuration.GetValue("MaxExistingGroupsByUser", 3)).ConfigureAwait(false); } } - else - { - dbContext.GroupPairs.Remove(userGroupPair); - } + + dbContext.GroupPairs.Remove(userGroupPair); await dbContext.SaveChangesAsync(); }