diff --git a/Remotely_Server/Data/DataService.cs b/Remotely_Server/Data/DataService.cs index c3d27482..043fa326 100644 --- a/Remotely_Server/Data/DataService.cs +++ b/Remotely_Server/Data/DataService.cs @@ -89,25 +89,6 @@ namespace Remotely_Server.Data }); } - public void CleanupEmptyOrganizations() - { - var emptyOrgs = RemotelyContext.Organizations - .Include(x => x.RemotelyUsers) - .Include(x => x.CommandContexts) - .Include(x => x.InviteLinks) - .Include(x => x.Devices) - .Include(x => x.SharedFiles) - .Include(x => x.PermissionGroups) - .Include(x => x.EventLogs) - .Where(x => x.RemotelyUsers.Count == 0); - - foreach (var emptyOrg in emptyOrgs) - { - RemotelyContext.Remove(emptyOrg); - } - RemotelyContext.SaveChanges(); - } - public bool DoesUserExist(string userName) { if (userName == null) @@ -477,13 +458,6 @@ namespace Remotely_Server.Data { RemotelyContext.Remove(x); }).Wait(); - - RemotelyContext.Devices - .Where(x => DateTime.Now - x.LastOnline > TimeSpan.FromDays(AppConfig.DataRetentionInDays)) - .ForEachAsync(x => - { - RemotelyContext.Remove(x); - }).Wait(); } } diff --git a/Remotely_Server/Startup.cs b/Remotely_Server/Startup.cs index 12c2f856..b9b02dbc 100644 --- a/Remotely_Server/Startup.cs +++ b/Remotely_Server/Startup.cs @@ -216,7 +216,6 @@ namespace Remotely_Server dataService.WriteEvent(ex); } dataService.SetAllDevicesNotOnline(); - dataService.CleanupEmptyOrganizations(); dataService.CleanupOldRecords(); }