Shared Items via secure link: Do not delete shared items that have not been viewed before cron runs

This commit is contained in:
johnnyq
2026-04-24 11:40:38 -04:00
parent 90de4e4fe3
commit e9c3ee4661

View File

@@ -105,7 +105,7 @@ logApp("Cron", "info", "Cron Started");
mysqli_query($mysqli, "TRUNCATE TABLE ticket_views");
// Clean-up shared items that have been used
mysqli_query($mysqli, "DELETE FROM shared_items WHERE item_views = item_view_limit");
mysqli_query($mysqli, "DELETE FROM shared_items WHERE item_view_limit > 0 AND item_views >= item_view_limit");
// Clean-up shared items that have expired
mysqli_query($mysqli, "DELETE FROM shared_items WHERE item_expire_at < NOW()");