aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-02-28 14:56:26 -0800
committerzotlabs <mike@macgirvin.com>2017-02-28 14:56:26 -0800
commitdf57e7ab93254d063b453a68f15d254079450cf9 (patch)
tree5da2cef437f99e571c5603432d34bb5d060f7bcb
parentfa02f3a1089975319df5a223c730f0f0249fd4bb (diff)
downloadvolse-hubzilla-df57e7ab93254d063b453a68f15d254079450cf9.tar.gz
volse-hubzilla-df57e7ab93254d063b453a68f15d254079450cf9.tar.bz2
volse-hubzilla-df57e7ab93254d063b453a68f15d254079450cf9.zip
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.
-rw-r--r--Zotlabs/Daemon/Cron_daily.php7
1 files changed, 7 insertions, 0 deletions
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();