perf(storage)!: optimize cleanup with secondary index

BREAKING CHANGE: This change requires a fresh database. Existing
databases will lack the index, and the cleanup routine will not function
correctly for pre-existing files.

Signed-off-by: skidoodle <contact@albert.lol>
This commit is contained in:
2026-01-18 22:10:07 +01:00
parent e18be18029
commit d18ef48bd4
5 changed files with 73 additions and 27 deletions
+4 -3
View File
@@ -35,9 +35,10 @@ const (
MinRetention = 24 * time.Hour
MaxRetention = 365 * 24 * time.Hour
DBFileName = "safebin.db"
DBBucketName = "files"
TempDirName = "tmp"
DBFileName = "safebin.db"
DBBucketName = "files"
DBBucketIndexName = "expiry_index"
TempDirName = "tmp"
)
type Config struct {