From df57e7ab93254d063b453a68f15d254079450cf9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 28 Feb 2017 14:56:26 -0800 Subject: expire unread system notifications after a year. It would provide a better experience for infrequent visitors if we didn't expire them at all, but at some point we need to draw a line so as not to degrade system performance searching through old notifications that it's highly unlikely will ever be viewed again. --- Zotlabs/Daemon/Cron_daily.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Daemon/Cron_daily.php b/Zotlabs/Daemon/Cron_daily.php index 0f0001890..038790572 100644 --- a/Zotlabs/Daemon/Cron_daily.php +++ b/Zotlabs/Daemon/Cron_daily.php @@ -38,6 +38,13 @@ class Cron_daily { db_utcnow(), db_quoteinterval('30 DAY') ); + // expire any unread notifications over a year old + + q("delete from notify where seen = 0 and created < %s - INTERVAL %s", + db_utcnow(), db_quoteinterval('1 YEAR') + ); + + //update statistics in config require_once('include/statistics_fns.php'); update_channels_total_stat(); -- cgit v1.2.3