From 96eb780f11e91aa1171999946a6e49eaaaa061dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=99Aquino?= Date: Wed, 18 Mar 2026 12:07:55 -0700 Subject: [PATCH] Reduce max age for stale temporary snapshots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix that implemented cleanup of temporary snapshots included a max age for stale temporary snapshots, which was originally set to 24h. This improved the situation, but it still meant that the app could accumulate 24 old snapshots, which leads to a non-trivial storage amount. This commit changes that to 30 minutes for better storage efficiency. The previous fix was not published on the App Store yet, so no changelog entry is needed. Closes: https://github.com/damus-io/damus/issues/3696 Changelog-None Signed-off-by: Daniel D’Aquino --- damus/Core/Storage/DatabaseSnapshotManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/damus/Core/Storage/DatabaseSnapshotManager.swift b/damus/Core/Storage/DatabaseSnapshotManager.swift index 61760404..a224b5bd 100644 --- a/damus/Core/Storage/DatabaseSnapshotManager.swift +++ b/damus/Core/Storage/DatabaseSnapshotManager.swift @@ -25,7 +25,7 @@ actor DatabaseSnapshotManager { private static let temporarySnapshotDirectoryPrefix = "snapshot_temp_" /// Maximum age for temporary snapshot directories before they are considered stale. - private static let staleTemporarySnapshotLifetime: TimeInterval = 60 * 60 * 24 + private static let staleTemporarySnapshotLifetime: TimeInterval = 60 * 30 // 30 minutes /// Key for storing last snapshot timestamp in UserDefaults private static let lastSnapshotDateKey = "lastDatabaseSnapshotDate"