From eb276c06f03d092edc9475c14e36f3ab86235324 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Mon, 21 Nov 2022 21:15:08 -0800 Subject: [PATCH] Remove cleaning limit --- DB/Sources/DB/Content/ContentDatabase.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/DB/Sources/DB/Content/ContentDatabase.swift b/DB/Sources/DB/Content/ContentDatabase.swift index 05a47ff..c010af6 100644 --- a/DB/Sources/DB/Content/ContentDatabase.swift +++ b/DB/Sources/DB/Content/ContentDatabase.swift @@ -671,7 +671,6 @@ public extension ContentDatabase { private extension ContentDatabase { static let cleanAfterLastReadIdCount = 40 - static let cleanLimit = 100 static let ephemeralTimelines = NSCountedSet() static func fileURL(id: Identity.Id, appGroup: String) throws -> URL { @@ -701,9 +700,8 @@ private extension ContentDatabase { let statusIdsToKeep = Set(statusIds).union(reblogStatusIds) let allStatusIds = try Status.Id.fetchSet(db, StatusRecord.select(StatusRecord.Columns.id)) - let staleStatusIds = allStatusIds.subtracting(statusIdsToKeep) - return Set(Array(staleStatusIds).prefix(Self.cleanLimit)) + return allStatusIds.subtracting(statusIdsToKeep) } static func accountIdsToDeleteForPositionPreservingClean(db: Database) throws -> Set { @@ -714,8 +712,7 @@ private extension ContentDatabase { && AccountRecord.Columns.movedId != nil) .select(AccountRecord.Columns.movedId))) let allAccountIds = try Account.Id.fetchSet(db, AccountRecord.select(AccountRecord.Columns.id)) - let staleAccountIds = allAccountIds.subtracting(accountIdsToKeep) - return Set(Array(staleAccountIds).prefix(Self.cleanLimit)) + return allAccountIds.subtracting(accountIdsToKeep) } }