Stop scheduled prunes at the quota target

Pruning previously deleted every photo in the plan; it now halts once usage is
back under the cleanup target, so a plan computed earlier cannot over-delete.
If the library is already below target the cleanup is cancelled and the owner is
notified instead. Notification emails also skip the "open Luminary" link when no
public URL is configured, and the admin panel keys the prune action off the
plan's freed bytes rather than the warning flag.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-23 15:28:25 +00:00
parent cd52a2f82f
commit c1f9d99d80
3 changed files with 60 additions and 34 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ db.exec(`
CREATE TABLE IF NOT EXISTS user_quota (
user_id TEXT PRIMARY KEY REFERENCES users(id) ON DELETE CASCADE,
bytes_limit INTEGER NOT NULL DEFAULT 100 * 1024 * 1024 * 1024,
bytes_limit INTEGER NOT NULL DEFAULT (100 * 1024 * 1024 * 1024),
prune_at INTEGER,
prune_plan TEXT,
prune_notified_at INTEGER,